playground-a11y.spec.ts 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { configureAxe } from 'vitest-axe'
  3. import { visitView } from '#tests/support/components/visitView.ts'
  4. describe('testing playground a11y', () => {
  5. it('has no accessibility violations', async () => {
  6. await visitView('/playground')
  7. const configuredAxe = configureAxe({
  8. // NB: Although "Playground" is not covered by any other tests, it is prudent to run at least a violation check.
  9. // Considering this screen is used for hoisting experimental components, it might uncover accessibility issues
  10. // early in the development process. However, if you need to ignore certain rule during checks of this page,
  11. // uncomment and adjust the block below.
  12. // https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axeconfigure
  13. // https://dequeuniversity.com/rules/axe/4.4
  14. /*
  15. rules: {
  16. label: {
  17. enabled: false,
  18. },
  19. },
  20. */
  21. })
  22. const results = await configuredAxe(document.body)
  23. expect(results).toHaveNoViolations()
  24. })
  25. })