-
Notifications
You must be signed in to change notification settings - Fork 469
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
getByRole('caption') does not find caption element #1289
Comments
Uh oh! @Amy-B-Tradition, the image you shared is missing helpful alt text. Check your issue body. Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs. |
1 similar comment
Uh oh! @Amy-B-Tradition, the image you shared is missing helpful alt text. Check your issue body. Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs. |
Hi @Amy-B-Tradition, thanks for opening this one :) |
Oh, sorry, I just saw this. If you still need this, I'll try to make some time this weekend. |
As we still didn't ship the alpha version, any input will help. |
This didn't work for me, but I think it's probably because dom testing library is wrapped by react-testing-library and installing the alpha doesn't make it available. LMK if there's something you'd like me to try |
Yeah, you'll need to use something like npm's |
Thanks for testing this @AmyBlankenship! |
I appreciate your hard work! |
v10.0.0 is now live with this update, and looks like react-testing-library v15.0.0 will drop soon, see testing-library/react-testing-library#1295 (and then overrides won't be needed). |
I'm resolving this one as DTL and RTL are already released :) |
16.20.2
Relevant code or config:
What you did:
test:
What happened:
Reproduction:
I think maybe this is it, but codesandbox gets harder and harder to use all the time and I was not able to find how to run the tests anymore
https://codesandbox.io/p/sandbox/react-testing-library-demo-forked-d8ztms?file=%2Fsrc%2F__tests__%2Fhello.js%3A10%2C1
Problem description:
According to the docs, caption should have an implicit caption aria role. You are not allowed to add an aria role to it, and even if you do, RTL errors out and doesn't find it
Suggested solution:
This should work
The text was updated successfully, but these errors were encountered: