-
Notifications
You must be signed in to change notification settings - Fork 1.1k
getByText doesn't find nodes that are <input type="submit" value="XXX"> #248
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
getByText doesn't find nodes that are <input type="submit" value="XXX"> #248
Comments
Interesting. I think that the query should be updated to account for this case. The change will actually be pretty simple in this file: https://github.com/kentcdodds/dom-testing-library/blob/master/src/get-node-text.js We'll want a test for this as well. Would you be willing to make that contribution? |
Yes, I'm interested in fixing this, but realistically I won't be able to get to it before Thursday or Friday. And if you see nothing before Friday it means it won't be before next year :-) (Precising this in case anybody wants to work on it before this). |
I realize that |
…it` (#185) * Make getByText support inputs where type is either `button` or `submit` Closes testing-library/react-testing-library#248 * change quotes
…it` (#185) * Make getByText support inputs where type is either `button` or `submit` Closes testing-library/react-testing-library#248 * change quotes
…it` (#185) * Make getByText support inputs where type is either `button` or `submit` Closes testing-library/react-testing-library#248 * change quotes
I use a code that contains an submit button like this:
With react-testing-library I want to get it using for example
getByText('Retrieve profiles')
, which I expect to work because the text'Retrieve profiles'
is actually seen by users.But this doesn't work and fails with this error:
Is this error expected in this case? I don't find an easy way to get to the submit button and have to use a matcher function instead...
The text was updated successfully, but these errors were encountered: