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

feat(ByRole): Allow filter by disabled state #1231

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Mar 9, 2023

@netlify
Copy link

netlify bot commented Mar 9, 2023

Deploy Preview for testing-library ready!

Name Link
🔨 Latest commit 3268d1a
🔍 Latest deploy log https://app.netlify.com/sites/testing-library/deploys/6409b14f18e644000857d53c
😎 Deploy Preview https://deploy-preview-1231--testing-library.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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>
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</body>
```

you can get the "Login" button by calling
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 })`.

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

Successfully merging this pull request may close these issues.

None yet

3 participants