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

fix(aria-errormessage): adds support for aria-errormessage #517

Merged
merged 3 commits into from
Oct 25, 2017

Conversation

AutoSponge
Copy link
Contributor

@AutoSponge AutoSponge commented Sep 9, 2017

@CLAassistant
Copy link

CLAassistant commented Sep 9, 2017

CLA assistant check
All committers have signed the CLA.

@AutoSponge
Copy link
Contributor Author

AutoSponge commented Sep 11, 2017

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.

Copy link
Contributor

@marcysutton marcysutton left a 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

@@ -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 () {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah. development artifact.

* @param {String} value The value of the attribute
* @return {Boolean}
*/
aria.validateIdrefType = function (doc, node, attr, value) {
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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?

@dylanb dylanb changed the title fix(aria-errormessage): adds support for wcag2.1 aria-errormessage fix(aria-errormessage): adds support for aria-errormessage Sep 12, 2017
@dylanb
Copy link
Contributor

dylanb commented Sep 12, 2017

@AutoSponge can you also remove the wcag2.1 from the commit message when you make this change

@marcysutton
Copy link
Contributor

marcysutton commented Sep 12, 2017

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.

@AutoSponge
Copy link
Contributor Author

@marcysutton I was thinking of aria1.1 but typed wcag2.1. I'll fix it.

@AutoSponge AutoSponge force-pushed the fix-aria-errormessage branch 2 times, most recently from 0d1c7d5 to 9361359 Compare September 13, 2017 00:02
@AutoSponge
Copy link
Contributor Author

Circle CI isn't showing me the failure (test section has infinite spinner) and I don't have permissions to trigger a build.

@dylanb
Copy link
Contributor

dylanb commented Sep 13, 2017

@AutoSponge

 1) aria-allowed-attr aria-allowed-attr passing tests passes should find ["#pass69"]:
     Element not found
  2) aria-allowed-attr aria-allowed-attr passing tests passes should find ["#pass70"]:
     Element not found
  3) aria-allowed-attr aria-allowed-attr passing tests passes should find ["#pass71"]:
     Element not found

@AutoSponge AutoSponge force-pushed the fix-aria-errormessage branch 6 times, most recently from 6a5baa4 to 836e5a8 Compare September 14, 2017 22:32
@WilcoFiers
Copy link
Contributor

@AutoSponge Any updates on this?

@AutoSponge
Copy link
Contributor Author

@WilcoFiers Github hasn't helped with the order of comments. My last comment was ~3 weeks ago:

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?

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
@marcysutton
Copy link
Contributor

marcysutton commented Oct 12, 2017

I do think we need a new aria-errormessage check to provide appropriate feedback to the user.

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!

@AutoSponge
Copy link
Contributor Author

@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.

@AutoSponge
Copy link
Contributor Author

AutoSponge commented Oct 14, 2017

@marcysutton I realized I could merge your changes here :)

@marcysutton
Copy link
Contributor

Thanks for the contribution, @AutoSponge!

@marcysutton marcysutton merged commit c96f58c into dequelabs:develop Oct 25, 2017
marcysutton pushed a commit that referenced this pull request Oct 25, 2017
* fix(aria-errormessage): adds support for aria-errormessage

* fix(aria-valid-attr-value): switches from `any` mode to `all`
marcysutton pushed a commit that referenced this pull request Oct 25, 2017
* fix(aria-errormessage): adds support for aria-errormessage

* fix(aria-valid-attr-value): switches from `any` mode to `all`
mrtnvh pushed a commit to mrtnvh/axe-core that referenced this pull request Nov 24, 2023
…equelabs#517)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

Add 'aria-errormessage' to definitions list
5 participants