Skip to content

feat: add support for @testing-library/user-event #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

delca85
Copy link
Member

@delca85 delca85 commented Jun 16, 2020

What:

I am trying to enable user launching user-event methods in QueryMarkup.
Right now the click event is enabled while the others are not enabled yet.
Furthermore it could be useful to have a toggle to switch between the original state and the one obtained executing user-event inserted method.

Why:

It would be an awesome feature like requested in issue #10 .

How:

  1. add userEvent to evaluator context
  2. make the execution to be effective
  3. retrieve code obtained by the execution of the user-event query on original markup
  4. inject new code in result and passing it to Preview in Playground component
  5. add evaluation of scripts inserted by the user in MarkupEditor in parser
  6. show a new message in Result when the user inserts a user-event method
  7. add toggle to switch between state after and before user-event method execution
  8. markup to be shown handled in usePlayground adding a new action type to reducer

Checklist:

  • add userEvent to evaluator context
  • make the execution to be effective (right now just the click method is working and performs an actual transformation on the original markup)
  • retrieve code obtained by the execution of the user-event query on original markup
  • inject new code in result and passing it to Preview in Playground component
  • add evaluation of scripts inserted by the user in MarkupEditor in parser
  • show a new message in Result when the user inserts a user-event method
  • add toggle to switch between state after and before user-event method execution
  • markup to be shown handled in usePlayground adding a new action type to reducer
  • Tests
  • Ready to be merged

To achieve the complete resolution of #10 managing of state after and before user-event method execution is still needed.

Right now the only user-event method that seems work is click.

@delca85 delca85 marked this pull request as draft June 16, 2020 22:44
@smeijer smeijer changed the title Feature/support user event feat: add support for @testing-library/user-event Jun 17, 2020
@smeijer
Copy link
Member

smeijer commented Jun 18, 2020

@delca85, I'm just checking in to let you know that I've seen the PR. I'll try to take a better look at it this weekend.

@smeijer
Copy link
Member

smeijer commented Jun 21, 2020

Hi @delca85!

Thanks for all the work you've done on this. Your research and attempt to resolve the issue, are much appreciated.

While working on the sandboxing ticket (#69), adding user-events (#10) became a logical next step. So I've decided to merge these two tickets together in one single PR (#209).

It still requires some polishing, but I got something working that enables us to use all user-events methods.

Thereby, I'm gonna close this PR. Thanks again for your time and effort.

@smeijer smeijer closed this Jun 21, 2020
@smeijer smeijer deleted the feature/support-user-event branch June 21, 2020 09:14
@delca85
Copy link
Member Author

delca85 commented Jun 21, 2020

I am happy you solved this issue and I am going to check your PR to deeply understand how you achieved that!

@nickserv nickserv restored the feature/support-user-event branch May 22, 2023 23:29
@nickserv nickserv deleted the feature/support-user-event branch May 22, 2023 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants