-
Notifications
You must be signed in to change notification settings - Fork 252
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
Relaxing element type definitions to HTMLElement #649
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c60735d:
|
src/__tests__/upload.js
Outdated
@@ -235,3 +235,12 @@ test('input.files implements iterable', () => { | |||
|
|||
expect(Array.from(eventTargetFiles)).toEqual(files) | |||
}) | |||
|
|||
test('should give error if we are trying to call upload on an invalid element', () => { |
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 is pretty much just a copy / paste from the existing test in paste.js.
Codecov Report
@@ Coverage Diff @@
## master #649 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 50 50
Lines 922 930 +8
Branches 363 366 +3
=========================================
+ Hits 922 930 +8
Continue to review full report at Codecov.
|
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 taking the time to contribute. ❤️
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've opened a PR with code suggestions at GreenGremlin#1
fix: guard against unsupported elements
@ph-fritsche thanks! I've merged your changes. |
@all-contributors add @GreenGremlin code |
I've put up a pull request to add @GreenGremlin! 🎉 |
🎉 This PR is included in version 13.1.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Thank you! |
Fixes #648
What: Relaxing element argument types to match the type returned by react-testing-library queries.
Why:
To allow user-event functions to be used with RTS queries without type casting.
How:
I'm narrowing the element type by checking that the passed elements are instances of valid element types. Thus, the check is runtime only, which makes sense since DOM queries are not fully type safe.
Checklist: