ticket-detail-view-a11y.spec.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. import { mockLinkListQuery } from '../graphql/queries/linkList.mocks.ts'
  10. describe('ticket detail view', () => {
  11. it('has no accessibility violations in main content', async () => {
  12. mockPermissions(['ticket.agent'])
  13. mockTicketQuery({
  14. ticket: createDummyTicket(),
  15. })
  16. mockLinkListQuery({
  17. linkList: [],
  18. })
  19. const testArticle = createDummyArticle()
  20. mockTicketArticlesQuery({
  21. articles: {
  22. totalCount: 1,
  23. edges: [{ node: testArticle }],
  24. },
  25. firstArticles: {
  26. edges: [{ node: testArticle }],
  27. },
  28. })
  29. const view = await visitView('/tickets/1')
  30. const results = await axe(view.html())
  31. expect(results).toHaveNoViolations()
  32. })
  33. })