Skip to content
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

New API: getByOwned(Element(s)) #3

Open
juanca opened this issue May 23, 2021 · 0 comments
Open

New API: getByOwned(Element(s)) #3

juanca opened this issue May 23, 2021 · 0 comments

Comments

@juanca
Copy link
Owner

juanca commented May 23, 2021

Not set on the name, etc. But the general idea is to encapsulate aria-owns and allowing easy test patterns for interactive content referenced by aria-owns.

Example: In ARIA 1.1, the combobox role has at most 2 owned elements: a textbox and a popup. The textbox is can be selected via a query such as screen.getByRole('role', { name }).querySelector('input') or screen.getByLabelText(name, { selector: 'input' }). However, this does not really test the aria-owns property.

I think we can do better than using a input selector. What about:

  • Step 1. Get element with aria-owns.
  • Step 2. Get all owned elements.
  • Step 3. Use a selector to filter/find a particular element.

e.g. screen.getByOwned('combobox', { name }, 'textbox')?

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

No branches or pull requests

1 participant