Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using https://github.com/eps1lon/dom-accessibility-api#dom-accessibility-api we add a custom matcher to make statements about the accessible name. This can be seen as the content that a screen reader will announce when the cursor is on the element.
The idea is that this will later be incorporated into
ByRole
. App tests will be written asgetByRole('textbox', { name: 'foo' })
while the library test verifies that the rendered textbox does indeed have the accessible name (via aria-label or aria-labelledby or label element).This will let us write better test that capture how the accessibility story of e.g. inputs looks. It is not obvious right now how to get this right and I don't want to rewrite a bunch of tests when we can improve the API and implementation later (see experimental
useUniqueId
orScope
).Implementation notes:
getComputedStyle
is faked locally