-
Notifications
You must be signed in to change notification settings - Fork 467
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('insertion')
and getByRole('deletion')
do not match semantic <del>
and <ins>
tags
#1288
Comments
Hi @rdwoodring, thanks for opening this one :) |
@MatanBobi I just tested it out using npm And anything I can do to help? Thanks |
Thanks @rdwoodring, appreciate you taking the time to test it. |
Ok, let me see what I can do. |
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). |
Thanks @jlp-craigmorten :) |
@testing-library/dom
version: 9.3.4@testing-libraray/react
version: 14.2.1jest
27.5.1jsdom
16.7.0Relevant code or config:
What you did:
Marking up insertions and deletions using the semantic
<ins>
and<del>
tags and creating assertions togetByRole
those semantic elementsWhat happened:
getByRole('insertion')
andgetByRole('deletion')
throw an error that no accessible roles were found.Reproduction:
https://github.com/rdwoodring/react-testing-library-ins-del
Problem description:
According to the W3C documentation linked by the testing library docs,
<del>
and<ins>
should have implicit roles ofdeletion
andinsertion
, respectively. When adding therole
explicitly (which is expressly not recommended in the very same W3C documentation), the elements are found correctly.Suggested solution:
The text was updated successfully, but these errors were encountered: