-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
TabPanel role with a incorrectly name when using getByRole (but works using getByText) #886
Comments
Thanks for the report.
Does this clear things up? |
I wonder if it's correct to look at Also I assumed |
It is correct by spec: https://www.w3.org/TR/accname-1.1/ Do you have an example of assistive technology the announces something different?
Then we wouldn't need two different APIs.
Sure:
-- https://testing-library.com/docs/queries/bytext/
|
Great thank you for the quick response. Would you mind giving a quick answer for this question as well?
|
I would recommend Tabpanels usually have quite a bit of content so querying by |
Ah okay. So doing this right?
I actually run into the issue of only one of the panels getting picked up. (Seems like non-visible panel via Edit: Here is the actual error log:
|
Yep, we exclude inaccessible elements by default (note that |
Yea the test is explicitly trying to test that the element doesn't show. I just gave it a try with Looks like it's getting picked up as a
|
Is the referenced element hidden? That would be the same issue as testing-library/dom-testing-library#846 for which we don't have a good solution. I suggest you add a |
Closing in favor of testing-library/dom-testing-library#846 |
"@testing-library/react": "11.0.2",
"@testing-library/user-event": "^13.0.2",
"@testing-library/jest-dom": "5.11.4"
I am using jest with latest version of CRA.
default Jest environment (JSDom)
Node version 14
Relevant code or config:
Here is the error I get when I try
I have been refactoring to use screen.getByRole with getByText and previous this test was working, but now it doesn't seem to work. Mainly the error I am getting is the following
and here are the rest of the error (notice the tabpanel where it expects Name as "Tab 1" instead of "Panel 1"):
The text was updated successfully, but these errors were encountered: