Testing Skip Navigation Accessibility Features in GatsbyJS
This test suite validates the accessibility features of skip navigation links in a Gatsby application. It ensures proper implementation of Reach UI’s skip navigation component and verifies both the presence and focus behavior of skip links for improved keyboard navigation.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
gatsbyjs/gatsby
examples/using-reach-skip-nav/cypress/integration/skip-nav.test.js
describe("Skip Navigation Test", function() {
it("Has a skip link", function() {
cy.visit("/")
cy.get("[data-reach-skip-link]").should("exist")
})
it("focuses skip link on navigation", function() {
cy.get("[data-cy-page-link]").click()
cy.focused().should("have.attr", "data-reach-skip-link")
})
})