personal-setting-out-of-office-a11y.spec.ts 995 B

1234567891011121314151617181920212223242526272829303132
  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 { mockUserCurrent } from '#tests/support/mock-userCurrent.ts'
  5. import { convertToGraphQLId } from '#shared/graphql/utils.ts'
  6. describe('testing out of office a11y view', async () => {
  7. beforeEach(() => {
  8. mockUserCurrent({
  9. firstname: 'John',
  10. lastname: 'Doe',
  11. outOfOffice: true,
  12. preferences: { out_of_office_text: 'OOF holiday' },
  13. outOfOfficeStartAt: '2024-03-01',
  14. outOfOfficeEndAt: '2024-04-01',
  15. outOfOfficeReplacement: {
  16. id: convertToGraphQLId('User', 256),
  17. internalId: 256,
  18. fullname: 'Example Agent',
  19. },
  20. })
  21. })
  22. it('has no accessibility violations', async () => {
  23. const view = await visitView('/personal-setting/out-of-office')
  24. const results = await axe(view.html())
  25. expect(results).toHaveNoViolations()
  26. })
  27. })