- Notifications
You must be signed in to change notification settings - Fork 466
Closed
Description
I'm fairly new to testing-library and I spent nearly an hour trying to figure out why my dialog isn't found by findByRole.
I can SEE my dialog in the DOM, but there's no error message like, "Hey, I see the dialog in the DOM, but it's hidden, add {hidden: true} to your query".
Sure, this might be a skill issue. I forgot that dialogs are hidden from the accessibility tree. But I can SEE the dialog, so it's not hidden right?
Describe the feature you'd like:
I can think of a few options,
- Change the name from 'hidden' to something that captures the meaning better. Maybe
ariaHidden - Show helpful errors
Maybe when you print the DOM to screen show a label next to it such as:
<dialog (hidden=true) aria-label=".." role="dialog" > - Add a hint in the error log
Unable to find role="dialog". Try adding "{hidden: true}" to your query
Metadata
Metadata
Assignees
Labels
No labels