You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testing Framework and version: react-scripts 5.0.0
DOM Environment: jsdom in react-scripts 5.0.0
What you did:
I'm trying to get a hidden element using getByRole, passing a name and setting hidden to true.
What happened:
It looks like the element name is empty when the element is hidden even when passing hidden: true to the options. Not sure if it's intended, but that's not what I expect. The same happens with aria-label.
This is the error:
Unable to find an element with the role "dialog" and name "Title"
Here are the available roles:
dialog:
Name "":
<div
aria-labelledby="title"
hidden=""
role="dialog"
/>
@testing-library/react
version: 12.1.2react-scripts
5.0.0react-scripts
5.0.0What you did:
I'm trying to get a hidden element using
getByRole
, passing aname
and settinghidden
totrue
.What happened:
It looks like the element name is empty when the element is hidden even when passing
hidden: true
to the options. Not sure if it's intended, but that's not what I expect. The same happens witharia-label
.This is the error:
Reproduction:
https://codesandbox.io/s/react-testing-library-does-not-find-hidden-element-by-accessible-name-6ncd2
The text was updated successfully, but these errors were encountered: