-
Notifications
You must be signed in to change notification settings - Fork 469
Closed
Description
@testing-library/dom
version: 8.13.0- Testing Framework and version: N/A
- DOM Environment: jsdom@19
Relevant code or config:
getByRole("graphics-document")
What you did:
I have an SVG element in the page which I'm trying to select by its role.
What happened:
In the W3 role documentation linked from the ByRole docs, it lists the implicit role for an SVG tag as graphics-document
. This value isn't included in the TypeScript definitions, but more importantly it isn't supported at runtime either.
Reproduction:
https://codesandbox.io/s/react-testing-library-demo-forked-rd79zt?file=/src/__tests__/hello.js
Problem description:
The only way to query for an SVG is via querySelector which goes against the recommendations of the library.
Suggested solution:
Support the aria-role as a selector as the documentation would suggest is possible.
foxaltus, freedude, Edugolr, Hesam-javadiun, TH-VF and 1 more
Metadata
Metadata
Assignees
Labels
No labels