-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Setup user-event inline once per test #40839
Conversation
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for following up, the change looks good to me — more verbose, but also more explicit 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing this one @ciampo 👍
While it is more verbose, following the recommendations from the official docs sounds like a good idea.
- Unit tests are passing
- All tests requiring the setup have been updated
LGTM 🚢
What?
Follow-up to #40790
As pointed out in this comment, currently
@testing-library/user-event
is setup once per test file while the official docs recommend setting it up inline, once per test.Why?
Following the official docs to avoid unexpected/unreliable behavior in unit tests.
How?
Refactored
UnitControl
andFormFileUpload
unit tests so that theuserEvent.setup()
call happens inline, once per test.Testing Instructions
Unit tests pass.