Replies: 1 comment 2 replies
-
Thanks for the feedback. This is already possible by injecting a custom implementation of With regards to testing-library, I wouldn't want to skip this check. You should instead not use the accessible name to query the element and use other queries like |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I created the following repository showcasing performance issues with React Testing Library's
ByRole
queries: https://github.com/ptamarit/find-by-role-perfIt's using Material-UI's date picker v3, and the test is accessing date buttons by role and accessible name.
I'm already using
hidden: true
to bypass thegetComputedStyle
call in DOM Testing Library.It improved performance, but it's still pretty bad.
The biggest time spent in the test is on
computeAccessibleName
.It's particularly visible in the case of this calendar as there are 30+ buttons, meaning that accessible names needs to be computed for all of these buttons to find matches.
Half of the time spent on
computeAccessibleName
is spent on theisHidden
method.Which brings me to the following questions:
dom-accessibility-api
allowing to skip this hidden check?dom-testing-library
could check ifByRole
is called withhidden: true
and pass it on todom-accessibility-api
.Happy to hear your thoughts.
Cheers,
Pablo
Beta Was this translation helpful? Give feedback.
All reactions