search-a11y.spec.ts 915 B

12345678910111213141516171819202122232425262728
  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 type { MockGraphQLInstance } from '#tests/support/mock-graphql-api.ts'
  5. import { mockPermissions } from '#tests/support/mock-permissions.ts'
  6. import { waitUntil } from '#tests/support/utils.ts'
  7. import { mockSearchOverview } from '../graphql/mocks/mockSearchOverview.ts'
  8. describe('testing search a11y', () => {
  9. let mockSearchApi: MockGraphQLInstance
  10. beforeEach(() => {
  11. mockSearchApi = mockSearchOverview([])
  12. mockPermissions(['ticket.agent'])
  13. })
  14. it('has no accessibility violations', async () => {
  15. const view = await visitView('/search/ticket?search=welcome')
  16. await waitUntil(() => mockSearchApi.calls.resolve)
  17. const results = await axe(view.html())
  18. expect(results).toHaveNoViolations()
  19. })
  20. })