diff --git a/lib/__tests__/index-test.js b/lib/__tests__/index-test.js index 3b62e4f..a331954 100644 --- a/lib/__tests__/index-test.js +++ b/lib/__tests__/index-test.js @@ -183,7 +183,7 @@ describe('tags', () => { describe('placeholder links without href', () => { it('does not warn', () => { doNotExpectWarning(assertions.tags.a.HASH_HREF_NEEDS_BUTTON.msg, () => { - ; + ; }); }); }); @@ -191,7 +191,7 @@ describe('tags', () => { describe('placeholder links without tabindex', () => { it('does not warn', () => { doNotExpectWarning(assertions.tags.a.TABINDEX_NEEDS_BUTTON.msg, () => { - ; + ; }); }); }); @@ -199,7 +199,7 @@ describe('tags', () => { describe('with [href="#"]', () => { it('warns', () => { expectWarning(assertions.tags.a.HASH_HREF_NEEDS_BUTTON.msg, () => { - ; + ; }); }); }); @@ -207,7 +207,7 @@ describe('tags', () => { describe('with [tabIndex="0"] and no href', () => { it('warns', () => { expectWarning(assertions.tags.a.TABINDEX_NEEDS_BUTTON.msg, () => { - ; + ; }); }); }); @@ -215,7 +215,7 @@ describe('tags', () => { describe('with a real href', () => { it('does not warn', () => { doNotExpectWarning(assertions.tags.a.HASH_HREF_NEEDS_BUTTON.msg, () => { - ; + ; }); }); }); @@ -248,55 +248,67 @@ describe('labels', () => { it('warns if there is no label on an interactive element', () => { expectWarning(assertions.render.NO_LABEL.msg, () => { - ; + ; + }); + }); + + it('warns if there is no label on a placeholder link', () => { + expectWarning(assertions.render.NO_LABEL.msg, () => { + ; + }); + }); + + it('does not warn when a placeholder link has a label', () => { + doNotExpectWarning(assertions.render.NO_LABEL.msg, () => { + foo; }); }); it('warns if there is no label on an element with an ARIA role', () => { expectWarning(assertions.render.NO_LABEL.msg, () => { - ; + ; }); }); it('does not warn when `role="presentation"`', () => { doNotExpectWarning(assertions.render.NO_LABEL.msg, () => { - ; + ; }); }); it('does not warn when `role="none"`', () => { doNotExpectWarning(assertions.render.NO_LABEL.msg, () => { - ; + ; }); }); it('does not warn when `aria-hidden="true"`', () => { doNotExpectWarning(assertions.render.NO_LABEL.msg, () => { - ; + ; }); }); it('warns when `aria-hidden="false"`', () => { expectWarning(assertions.render.NO_LABEL.msg, () => { - ; + ; }); }); it('does not warn if the element is not interactive', () => { doNotExpectWarning(assertions.render.NO_LABEL.msg, () => { -
; + ; }); }); it('does not warn if there is an aria-label', () => { doNotExpectWarning(assertions.render.NO_LABEL.msg, () => { - ; + ; }); }); it('does not warn if there is an aria-labelled-by', () => { doNotExpectWarning(assertions.render.NO_LABEL.msg, () => { - ; + ; }); }); @@ -355,12 +367,6 @@ describe('labels', () => { }); }); - it('does not warn if an anchor has no href', () => { - doNotExpectWarning(assertions.render.NO_LABEL.msg, () => { - ; - }); - }); - it('warns if an anchor has a tabIndex but no href', () => { expectWarning(assertions.render.NO_LABEL.msg, () => { ; @@ -438,7 +444,7 @@ describe('labels', () => { render: function() { return (