Skip to content

Instantly share code, notes, and snippets.

@craigcarlyle
Created August 3, 2018 18:42
Show Gist options
  • Save craigcarlyle/9afd75a4757c7adde72bf3f05dfcbf57 to your computer and use it in GitHub Desktop.
Save craigcarlyle/9afd75a4757c7adde72bf3f05dfcbf57 to your computer and use it in GitHub Desktop.
a11y Cypress Example
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