ticket-detail-view-a11y.spec.ts 1.2 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 { mockPermissions } from '#tests/support/mock-permissions.ts'
  5. import { mockTicketArticlesQuery } from '#shared/entities/ticket/graphql/queries/ticket/articles.mocks.ts'
  6. import { mockTicketQuery } from '#shared/entities/ticket/graphql/queries/ticket.mocks.ts'
  7. import { createDummyArticle } from '#shared/entities/ticket-article/__tests__/mocks/ticket-articles.ts'
  8. import { createDummyTicket } from '#shared/entities/ticket-article/__tests__/mocks/ticket.ts'
  9. describe('ticket detail view', () => {
  10. it('has no accessibility violations in main content', async () => {
  11. mockPermissions(['ticket.agent'])
  12. mockTicketQuery({
  13. ticket: createDummyTicket(),
  14. })
  15. const testArticle = createDummyArticle()
  16. mockTicketArticlesQuery({
  17. articles: {
  18. totalCount: 1,
  19. edges: [{ node: testArticle }],
  20. },
  21. firstArticles: {
  22. edges: [{ node: testArticle }],
  23. },
  24. })
  25. const view = await visitView('/tickets/1')
  26. const results = await axe(view.html())
  27. expect(results).toHaveNoViolations()
  28. })
  29. })