-
Notifications
You must be signed in to change notification settings - Fork 470
getByRole
is unable to find an accessible elements in nested react components
#1173
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
Comments
Hi @shadaxv, thanks for opening this one. |
Hi @MatanBobi, thank you for your quick reply, I was just about to close the issue because I already found this thread - #567 I think it is simply caused by the fact that the input with the password type, does not have its role, aria-label also will not work in this case, but thank you very much for the suggestion For anyone who stumbles across this thread: instead of |
Wasn't familiar with that one.. Thanks! |
hello i used getByLabelText but i had to remove 'toBeInTheDocument()' for it to work can you help me to understand why? here is the code:
|
@urbain32 - We'll need more data to try and help you with that issue. |
Hello guys! I want to test a fail scenario. ` render()
Please help :) |
@PeymanOruji You can follow the guides here: |
Thank you sir.
Can i ask another question?
How we can test valid date ? :)
…On Sun, Aug 6, 2023, 11:21 Matan Borenkraout ***@***.***> wrote:
@PeymanOruji <https://github.com/PeymanOruji> You can follow the guides
here:
https://testing-library.com/docs/guide-disappearance#asserting-elements-are-not-present
—
Reply to this email directly, view it on GitHub
<#1173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMN35H5OTCGTQZEMNSF6WALXT45HVANCNFSM6AAAAAAQVRP4OA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I can't really understand what you mean with this question and this issue is aimed to provide answer for something else. |
Uh oh!
There was an error while loading. Please reload this page.
@testing-library/dom
version: 8.17.1@testing-library/[email protected]
+@testing-library/[email protected]
+[email protected]
[email protected]
Relevant code or config:
Tested component
Test
What you did:
I want to test a component by using getByRole query, which uses another component underneath
What happened:
Query getByRole does not find an accessible element, however, any other query can find the element (e.g. getByTestId, getByText)
Error output
Reproduction:
https://codesandbox.io/s/react-testing-library-demo-forked-v3dz08
Problem description:
Testing library is unable to find an accessible element in nested react components
Suggested solution:
Testing library should find an accessible element in a nested structure
The text was updated successfully, but these errors were encountered: