signup-a11y.spec.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { axe } from 'vitest-axe'
  3. import { visitView } from '#tests/support/components/visitView.ts'
  4. import { mockApplicationConfig } from '#tests/support/mock-applicationConfig.ts'
  5. import { mockPublicLinksQuery } from '#shared/entities/public-links/graphql/queries/links.mocks.ts'
  6. describe('testing signup a11y', () => {
  7. beforeEach(() => {
  8. mockApplicationConfig({
  9. user_create_account: true,
  10. })
  11. })
  12. it('has no accessibility violations', async () => {
  13. const publicLinks = [
  14. {
  15. title: 'Imprint',
  16. link: 'https://example.com/imprint',
  17. description: 'A test description',
  18. },
  19. {
  20. title: 'Privacy policy',
  21. link: 'https://example.com/privacy',
  22. description: null,
  23. },
  24. ]
  25. mockPublicLinksQuery({
  26. publicLinks,
  27. })
  28. const view = await visitView('/signup')
  29. const results = await axe(view.html())
  30. expect(results).toHaveNoViolations()
  31. })
  32. })