Skip to content

Image and combobox are not being detected by the getByRole. #1238

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

Closed
lakshman0369 opened this issue Jun 14, 2023 · 2 comments · Fixed by #1237
Closed

Image and combobox are not being detected by the getByRole. #1238

lakshman0369 opened this issue Jun 14, 2023 · 2 comments · Fixed by #1237

Comments

@lakshman0369
Copy link

Describe the bug

Image tagged element and combobox are not being detected by the getByRole query.

Aria-query previous working version - 5.1.3
Aria-query upgraded version version - 5.2.1
"@testing-library/react": "12.0.0"

<img src="/rcore/static/media/AccessDenied_Icon.db53e967.svg" alt="" class="sc-lmJFLr hLGeOl sc-jRBLiq ghkJEk" id="">

Previously before the 'aria-query' upgrade, getByRole query will detect the above element. But after the upgrade this query is not able to detect the above element.

We have many test cases that are breaking due to above issue . This behavior is happening since v5.2.1. Please fix the issue above issue.

@botoxparty
Copy link

I'm experiencing the same behaviour here.

For example I get this message:

    TestingLibraryElementError: Unable to find an accessible element with the role "img"

    Here are the accessible roles:

      presentation:

      Name "AD_TITLE":
      <img
        alt="AD_TITLE"
        class="jsx-2547541157"
        src="test-file-stub"
      />

So there is definitely an img element there, but it's not detecting it. I am currently upgrading from 12 to 14.

@MatanBobi
Copy link
Member

This might be related to #1235, we'll need to look into it.
Can you please add more info about the queries you're running and the elements you're trying to query?
Thank you.

@MatanBobi MatanBobi transferred this issue from testing-library/react-testing-library Jun 14, 2023
@MatanBobi MatanBobi mentioned this issue Jun 14, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants