Skip to content

Commit 3b872fc

Browse files
committed
Merge pull request #88 from rackt/fix-aria-labelledby
[fixed] correctly accounting for aria-labelledby (resolves #87)
2 parents 6aa203d + 26afd1e commit 3b872fc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/__tests__/index-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ describe('labels', () => {
314314
});
315315
});
316316

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

lib/assertions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ exports.tags = {
226226

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

242242
var failed = !(
243243
props['aria-label'] ||
244-
props['aria-labelled-by'] ||
244+
props['aria-labelledby'] ||
245245
(tagName === 'img' && props.alt) ||
246246
hasChildTextNode(props, children, failureCB)
247247
);

0 commit comments

Comments
 (0)