-
Notifications
You must be signed in to change notification settings - Fork 401
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
Add support for aria-disabled in toBeDisabled/toBeEnabled #146
Conversation
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.
Looks good. Some comments.
const isDisabled = isElementDisabled(element) || isAncestorDisabled(element) | ||
const isDisabled = | ||
hasAriaDisabled(element) || | ||
isElementDisabled(element) || |
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 wonder if there's some issue when having conflicting signals in an element that has different values for disabled
and aria-disabled
. Not saying we need to do anything about it, just wondering.
Not sure if this is a |
The problem is that aria-disabled is only an atrribute for assistive technology while the disabled property has more implications (cant click or focus etc). So this matcher asserts very different things depending on which attribute is used. So I do think your test should reflect that. |
Hmmmm, you bring up a good point @eps1lon but so much so that I now wonder if these two slightly different concepts of disabling an element should be expressed under the same matcher. I was indeed also worried about what to do when we have conflicting signals (e.g. I'd say that we make it so we issue an error when we see that the BTW, I'm also not sure how our tests should reflect what you bring up. Are you suggesting that we test that we can or cannot focus or click on elements accordingly? |
If someone researches how |
Just wanted to note that the discussion has apparently been moved to the issue (#144). Just so that we avoid having duplicate discussions about this, I guess the issue is better suited for this, since the objections are not with the implementation but with the feature proposal. Also @eps1lon already took the lead. |
Hi, I'm closing this for the same reasons stated in #144 (comment). Feel free to continue the discussion there if you think there's something else yet to be said or discussed. |
What:
aria-disabled
intoBeDisabled/toBeEnabled
add aria-disabled in thetoBeDisabled
matcher #144jsdom
dependency until it is fixed latest version of jsdom (15.2.0) causes focus test to fail #145npm run format
Closes #144
Checklist: