Closed rdwoodring closed 7 months ago
Hi @rdwoodring, thanks for opening this one :)
Any chance you can test this against our alpha release? (can be installed using npm install @testing-library/dom@alpha
). We've updated the underlying package (aria-query
) there. We're still running some tests and I didn't get a chance to push it forwards to a release but having someone else testing that release will really help us.
Thanks!
@MatanBobi I just tested it out using npm overrides
to force @testing-library/react
to use the alpha of @testing-library/dom
and it seems that the issue is, indeed, resolved there. Any idea when that'll be released and when it will trickle down into @testing-library/react
?
And anything I can do to help?
Thanks
Thanks @rdwoodring, appreciate you taking the time to test it. Currently, I'm out of capacity to test it in some of my projects, that's why we're holding it back. If you can run it on your entire project to see that you're not experiencing any regression it will be extremely valuable. Thanks again!
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 https://github.com/testing-library/react-testing-library/pull/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: