-
Notifications
You must be signed in to change notification settings - Fork 780
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
fix(aria-errormessage): adds support for aria-errormessage #517
fix(aria-errormessage): adds support for aria-errormessage #517
Conversation
I noticed #497 (comment); if you need me to retarget this PR to a feature branch (not develop), have a maintainer create the target branch and I will update this PR. This PR can be accepted then someone can create a new PR from feature TBD to develop. |
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.
Targeting develop is fine. We'll cherry-pick it onto develop-2x too so the changes go into 2x as well as 3x.
The test will need .only
removed, and it would be good to link to the spec documentation in your commit.
Can you add some DOM elements to the integration tests? I just had to do something similar: 9b4d2ee
test/checks/aria/valid-attr-value.js
Outdated
@@ -60,6 +60,23 @@ describe('aria-valid-attr-value', function () { | |||
assert.isNull(checkContext._data); | |||
}); | |||
|
|||
it.only('should return true if aria-errormessage id is alert or aria-describedby', function () { |
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.
Need to remove the .only
here.
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.
ah. development artifact.
lib/commons/aria/attributes.js
Outdated
* @param {String} value The value of the attribute | ||
* @return {Boolean} | ||
*/ | ||
aria.validateIdrefType = function (doc, node, attr, value) { |
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.
The logic looks excellent to me. What I'm wondering is if there's a better way of communicating what's going on to users. The proposed implementation doesn't give any sort of feedback about why in one case aria-errormessage
is passed and in another it is failed. It'd be great if we could expose that somehow. I'm not too sure how we'd go about doing that though... Perhaps we could have a separate check for aria-errormessage
? It could be a none
check, that raises an error if none of these three cases are met. What do you think?
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.
So, if this fn throws and I include a test for throws
...
throw new Error('The value of aria-errormessage must be supported using an additional technique that announces the message (e.g., aria-live, aria-describedby, role=alert, etc.)')
Is that enough? Too much?
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.
The tests are passing. The only thing I haven't tried to do is:
Perhaps we could have a separate check for aria-errormessage?
Given my lack of familiarity with the testing harness, I'm not sure how I would go about that. Is it possible to make that an additional feature?
@AutoSponge can you also remove the |
I asked him to put a link to the 2.1 spec in the commit, I should have been more specific. The commit body has a lot more room for stuff like that. The first line of the commit message should be under 100 characters. |
@marcysutton I was thinking of aria1.1 but typed wcag2.1. I'll fix it. |
0d1c7d5
to
9361359
Compare
Circle CI isn't showing me the failure (test section has infinite spinner) and I don't have permissions to trigger a build. |
|
6a5baa4
to
836e5a8
Compare
836e5a8
to
cb8e39c
Compare
@AutoSponge Any updates on this? |
@WilcoFiers Github hasn't helped with the order of comments. My last comment was ~3 weeks ago:
I was waiting on input from you guys but @dylanb said you were on vacation so I didn't bug you :) |
Integration tests are failing, but I couldn't figure out why. The union of the two checks seems to be causing problems
I do think we need a new I started to fix this but I got hung up on the integration tests. The two checks are interfering with each other...it's unclear to me what exactly is happening. @AutoSponge you can see what I did here: 4ae3fc3?diff=unified I have to move on to other stuff, so if someone else can pick this up that would help a lot! |
@marcysutton I commented on your commit but it doesn't show here. So, just commenting to make sure you see: 4ae3fc3?diff=unified. When I made those changes it worked locally but I can't push to your branch. |
@marcysutton I realized I could merge your changes here :) |
Thanks for the contribution, @AutoSponge! |
* fix(aria-errormessage): adds support for aria-errormessage * fix(aria-valid-attr-value): switches from `any` mode to `all`
* fix(aria-errormessage): adds support for aria-errormessage * fix(aria-valid-attr-value): switches from `any` mode to `all`
…equelabs#517) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
closes #499
see https://www.w3.org/TR/wai-aria-1.1/#aria-errormessage