-
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
Use @testing-library/user-event in BoxControl
tests
#41422
Conversation
Size Change: 0 B Total Size: 1.24 MB ℹ️ View Unchanged
|
expect( spyChange ).toHaveBeenLastCalledWith( { | ||
top: undefined, | ||
right: undefined, | ||
bottom: undefined, | ||
left: undefined, | ||
} ); |
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.
This test wasn't previously testing what onChange
was called with. It seems appropriate to cover because even if the input remains empty, the feature may break as mentioned in #40518 (comment).
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.
These changes look great @stokesman. 👍
The tests are even easier to read and the increased coverage around the onChange
handling is a win.
✅ Unit tests are passing
✅ No surprises in the code changes
✅ Current iOS e2e failure is unrelated
LGTM 🚢
* Use @testing-library/user-event in `BoxControl` tests * Add changelog entry
What?
Updates the
BoxControl
unit tests to use@testing-library/user-event
for interacting with the component and modifies one test to cover itsonChange
handling.Why?
How?
https://testing-library.com/docs/ecosystem-user-event/
Testing Instructions
npm run test-unit /box-control