Created
August 3, 2018 18:42
-
-
Save craigcarlyle/9afd75a4757c7adde72bf3f05dfcbf57 to your computer and use it in GitHub Desktop.
a11y Cypress Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("Checkbox", () => { | |
describe("a11y", () => { | |
beforeEach(() => { | |
cy.visit("/component/th-checkbox/example/5"); | |
}); | |
describe("aria-label", () => { | |
describe("without an aria-label attribute specified", () => { | |
it("has an aria-label attribute identical to the checkbox's with-label attribute", () => { | |
cy.get("#axe-test #basic.th-checkbox").should("have.attr", "aria-label", "Basic Checkbox"); | |
}); | |
}); | |
describe("with an aria-label attribute specified", () => { | |
it("has an aria-label attribute with the value provided", () => { | |
cy.get("#axe-test #aria-label.th-checkbox").should("have.attr", "aria-label", "Aria-Label"); | |
}); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment