testing-library / testing-library/dom-testing-library
Support abstract roles
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 474
- PR merge metrics
- No merged PRs in 30d
Description
Describe the feature you'd like:
It would be useful if we could, for example, get all inputs with getAllByRole('input').
This seems to be one of the abstract roles, and as far as I can tell, these are not supported currently:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#6._abstract_roles
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/input_role
Expected result is that <input type="text"> would have both textbox and input roles (as input is a superclass of textbox).
This would make testing a lot more flexible.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no implementation files or tests. Start by locating the role-query and accessible-role logic and its existing role tests; completion should make getAllByRole('input') include text inputs that already match the textbox role without changing existing role behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- accessibility, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100