-
Notifications
You must be signed in to change notification settings - Fork 470
can't find element by role code
#1100
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 @chiptus! For this specific use-case, I suggest either setting an explicit role on your own or query the element with a different approach :) I'm closing this one as this is the wanted behavior in this scenario. |
@MatanBobi I have run into this problem today, so it will be cool if you're add this role. Thank you. |
Thanks @EmeraldWeb! |
Bumping because this issue still isn't resolved |
@CalebJamesStevens, there's no need to bump this issue, we're waiting for |
v10.0.0 is now live with this update. |
Thanks @jlp-craigmorten! @all-contributors please add @jlp-craigmorten for question |
I've put up a pull request to add @jlp-craigmorten! 🎉 |
- Needed to be able to access <code/> elements by role (see: testing-library/dom-testing-library#1100)
- Needed to be able to access <code/> elements by role (see: testing-library/dom-testing-library#1100)
* feat(#62): adjust code block styles to accomodate line highlighting * chore(#62): bump versions @testing-library/* versions - Needed to be able to access <code/> elements by role (see: testing-library/dom-testing-library#1100) * chore(#62): major version update for prism-react-renderer * refactor(#62): improve code readability * feat(#62): add support for highlight-line comments * fix(#62): lint * feat(#62): add support for highlight-start / highlight-end comments * feat(#62): add support for highlight-next-line comments * refactor(#62): group initial shouldHighlightLine values * fix(#62): move codeClassNames into getLineProps, to avoid overwriting the token-line class from prism-react-renderer * fix(#62): update line highlight color to match Night Owl theme * refactor(#62): clean up semantic HTML structure - use figure/figcaption instead of div - use only one code element (vs one per line) * fix(#62): fix padding on pre element when no language tag or file tag * feat(#62): update semantics for highlighted lines to use <mark> * content(#62): refactor code blocks to use line highlights instead of comments * fix(#62): make font size consistent on iOS
@testing-library/dom
version: 12.1.2jest 27.4.3
jsdom 16.6.0
Relevant code or config:
component
test
What you did:
I searched the code element by role
code
, I expected to find it by https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/structural_rolesWhat happened:
The element is not found
Reproduction:
https://codesandbox.io/s/fail-to-find-role-code-qpzrs?file=/src/__tests__/hello.js
Problem description:
Per testing-library docs, it seems like it should work, as when I check the role of the element in chrome dev tools, I see 'code' as expected.
Suggested solution:
not sure, I've seen that aria-query doesn't support this role.
The text was updated successfully, but these errors were encountered: