Created
August 3, 2018 18:46
-
-
Save craigcarlyle/a84dff319691caf53d480e9c2c339d87 to your computer and use it in GitHub Desktop.
a11y KeyDown Usage
This file contains 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("Keyboard Interactions", () => { | |
describe("when checkbox has focus and the 'Space' key is pressed", () => { | |
describe("while unchecked", () => { | |
it("checks the checkbox", () => { | |
cy.keyDown("#axe-test #basic.th-checkbox", "Space"); | |
cy.get("#axe-test #basic.th-checkbox").should("have.attr", "aria-checked", "true"); | |
}); | |
}); | |
describe("while checked", () => { | |
it("unchecks the checkbox", () => { | |
cy.keyDown("#axe-test #basic.th-checkbox", "Space"); | |
cy.keyDown("#axe-test #basic.th-checkbox", "Space"); | |
cy.get("#axe-test #basic.th-checkbox").should("have.attr", "aria-checked", "false"); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment