Skip to content

Commit

Permalink
[fixed] correctly accounting for aria-labelledby (resolves #87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Kloots committed Aug 18, 2015
1 parent 6aa203d commit 26afd1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/__tests__/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ describe('labels', () => {
});
});

it('does not warn if there is an aria-labelled-by', () => {
it('does not warn if there is an aria-labelledby', () => {
doNotExpectWarning(assertions.render.NO_LABEL.msg, () => {
<button aria-labelled-by="foo"/>;
<button aria-labelledby="foo"/>;
});
});

Expand Down
4 changes: 2 additions & 2 deletions lib/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ exports.tags = {

exports.render = {
NO_LABEL: {
msg: 'You have an unlabled element or control. Add `aria-label` or `aria-labelled-by` attribute, or put some text in the element.',
msg: 'You have an unlabled element or control. Add `aria-label` or `aria-labelledby` attribute, or put some text in the element.',
test (tagName, props, children, failureCB) {
if (isHiddenFromAT(props) || presentationRoles.has(props.role))
return;
Expand All @@ -241,7 +241,7 @@ exports.render = {

var failed = !(
props['aria-label'] ||
props['aria-labelled-by'] ||
props['aria-labelledby'] ||
(tagName === 'img' && props.alt) ||
hasChildTextNode(props, children, failureCB)
);
Expand Down

0 comments on commit 26afd1e

Please sign in to comment.