-
Notifications
You must be signed in to change notification settings - Fork 470
feat(fireEvent): helper to assign target properties to node #85
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
1234404
to
1b420b8
Compare
I'd love feedback on this. This change will mean we can remove |
Specifically this is so the change event can set the value of the node in a way that works for React (and all other frameworks and non-frameworks) nicely. fixes: testing-library/react-testing-library#152
1b420b8
to
1828405
Compare
Codecov Report
@@ Coverage Diff @@
## master #85 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 9 9
Lines 152 161 +9
Branches 39 44 +5
=====================================
+ Hits 152 161 +9
Continue to review full report at Codecov.
|
fireEvent.change(node, {target: {value: 'a'}}), | ||
).toThrowErrorMatchingInlineSnapshot( | ||
`"The given element does not have a value setter"`, | ||
) |
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.
I just gotta say, this inline snapshot business is just the best.
Ok, I'll go ahead and self-approve this PR. I hope I don't regret this! 😅 |
🎉 This PR is included in version 3.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
@kentcdodds looks good! sorry i couldn't review it before it got merged!
Thanks @jomaxx! |
What: feat(fireEvent): helper to assign target properties to node
Why: Specifically this is so the change event can set the value of the node
in a way that works for React (and all other frameworks and
non-frameworks) nicely.
fixes: testing-library/react-testing-library#152
How: Add some logic to the
fireEvent
utility, and borrow some code from a thread in react issues.Checklist: