-
Notifications
You must be signed in to change notification settings - Fork 470
fix: support getting text of inputs of type reset
#1011
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
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 429d27e:
|
|
Just saw we do have support for "submit" 😕 |
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!
@G-Rath Please fix CI. The checks include the task that are run (https://github.com/testing-library/dom-testing-library/runs/3382484950). To start, run |
Codecov Report
@@ Coverage Diff @@
## main #1011 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 25 25
Lines 916 916
Branches 285 285
=========================================
Hits 916 916
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Thanks! @all-contributors add @G-Rath for code and test |
I've put up a pull request to add @G-Rath! 🎉 |
🎉 This PR is included in version 8.1.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What:
Currently doing
screen.getByText('Reset')
results in an error about being unable to find the text if you're testing for an input like so:But this works fine if you try and select the "submit" input in the same manner:
screen.getByText('Submit')
Why:
#185 added support for treating inputs of type
submit
&button
as if they have text, but it left outreset
which is the third "type" that has this behaviour.How:
I've adjusted the query to include
type=reset
.Checklist:
docs site N/A I think (I couldn't find docs on this specific behaviour)