-
Notifications
You must be signed in to change notification settings - Fork 718
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
feat(ByRole): Allow filter by disabled state #1231
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for testing-library ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
<body> | ||
<section> | ||
<button disabled>Login</button> | ||
<div role="alert" aria-disabled="false">Failed to login</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the aria-disabled
here seems a bit confusing to me.
Are we also filtering by aria-disabled
or just by the disabled
attribute? I think that we should explain it here so people will have a clear understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're filtering by things that are disabled according to the a11y tree. This applies to every filter option in ByRole
.
This here includes examples.
How would you explain it do avoid confusions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking about something like this maybe?
https://github.com/testing-library/testing-library-docs/pull/1231/files#r1148318567
</body> | ||
``` | ||
|
||
you can get the "Login" button by calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can get the "Login" button by calling | |
You can get the "Login" button by calling `getByRole('button', { disabled: true })` and the alert by calling `getByRole('alert', { disabled: false })`. |
Docs for testing-library/dom-testing-library#1221
Rendered preview