Skip to content
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

Wrap everything in eventWrapper #384

Closed
kentcdodds opened this issue Jun 25, 2020 · 2 comments · Fixed by #385
Closed

Wrap everything in eventWrapper #384

kentcdodds opened this issue Jun 25, 2020 · 2 comments · Fixed by #385
Labels

Comments

@kentcdodds
Copy link
Member

Normally, we call fireEvent to trigger events, and that should already be wrapped in the eventWrapper. If the user's using @testing-library/react, then this eventWrapper will be act.

However, we don't always use fireEvent and if this were to trigger a state update:

element.focus()

Then we're toast.

So I see two solutions to this:

  1. Wrap every function in eventWrapper
  2. Find everywhere we're triggering events and wrap them individually

I think if option 1 will work (and I think it will) then that's the easiest and will allow us to avoid issues of people forgetting to add it in the future.

@kentcdodds
Copy link
Member Author

I'm almost done with this. Going with option 1 because I verified it'll work :)

@kentcdodds
Copy link
Member Author

🎉 This issue has been resolved in version 12.0.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant