personal-setting-notification-a11y.spec.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 { mockUserCurrent } from '#tests/support/mock-userCurrent.ts'
  6. describe('testing password a11y view', async () => {
  7. beforeEach(() => {
  8. mockUserCurrent({
  9. firstname: 'John',
  10. lastname: 'Doe',
  11. preferences: {
  12. notification_sound: {
  13. enabled: true,
  14. file: 'Xylo.mp3',
  15. },
  16. notification_config: {
  17. group_ids: ['1', '2'],
  18. matrix: {
  19. create: {
  20. criteria: {
  21. owned_by_me: true,
  22. owned_by_nobody: true,
  23. subscribed: true,
  24. no: false,
  25. },
  26. channel: { email: true, online: true },
  27. },
  28. update: {
  29. criteria: {
  30. owned_by_me: true,
  31. owned_by_nobody: true,
  32. subscribed: true,
  33. no: false,
  34. },
  35. channel: { email: true, online: true },
  36. },
  37. reminder_reached: {
  38. criteria: {
  39. owned_by_me: true,
  40. owned_by_nobody: false,
  41. subscribed: false,
  42. no: false,
  43. },
  44. channel: { email: true, online: true },
  45. },
  46. escalation: {
  47. criteria: {
  48. owned_by_me: true,
  49. owned_by_nobody: false,
  50. subscribed: false,
  51. no: false,
  52. },
  53. channel: { email: true, online: true },
  54. },
  55. },
  56. },
  57. },
  58. })
  59. mockPermissions(['user_preferences.notifications'])
  60. })
  61. it('has no accessibility violations', async () => {
  62. const view = await visitView('/personal-setting/notifications')
  63. const results = await axe(view.html())
  64. expect(results).toHaveNoViolations()
  65. })
  66. })