0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 18:26:15 +01:00
posthog/cypress/e2e/a11y.cy.ts
2022-12-30 21:27:26 +01:00

35 lines
1.0 KiB
TypeScript

import { reportA11y } from '../support/accessibility'
describe('a11y', () => {
it('home should have no accessibility violations', () => {
cy.get('[data-attr="menu-item-projecthomepage"]').click()
cy.injectAxe()
reportA11y({ includedImpacts: ['critical'] }, 'home-page-critical', true)
reportA11y({ includedImpacts: ['serious'] }, 'home-page-serious', true)
})
const sidebarItems = [
'dashboards',
'savedinsights',
'sessionsrecordings',
'featureflags',
'experiments',
'events',
'datamanagement',
'persons',
'cohorts',
'annotations',
'plugins',
'toolbarlaunch',
'projectsettings',
]
sidebarItems.forEach((sideBarItem) => {
it(`${sideBarItem} should have no accessibility violations`, () => {
cy.clickNavMenu(sideBarItem)
cy.injectAxe()
reportA11y({ includedImpacts: ['serious', 'critical'] }, sideBarItem)
})
})
})