Browse Source

Maintenance: Add a11y frontend integration test for the new out of office personal settings.

Dominik Klein 10 months ago
parent
commit
f09d27e9a2

+ 30 - 0
app/frontend/apps/desktop/pages/personal-setting/__tests__/personal-setting-out-of-office-a11y.spec.ts

@@ -0,0 +1,30 @@
+// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
+
+import { axe } from 'vitest-axe'
+import { visitView } from '#tests/support/components/visitView.ts'
+import { mockAccount } from '#tests/support/mock-account.ts'
+import { convertToGraphQLId } from '#shared/graphql/utils.ts'
+
+describe('testing out of office a11y view', async () => {
+  beforeEach(() => {
+    mockAccount({
+      firstname: 'John',
+      lastname: 'Doe',
+      outOfOffice: true,
+      preferences: { out_of_office_text: 'OOF holiday' },
+      outOfOfficeStartAt: '2024-03-01',
+      outOfOfficeEndAt: '2024-04-01',
+      outOfOfficeReplacement: {
+        id: convertToGraphQLId('User', 256),
+        internalId: 256,
+        fullname: 'Example Agent',
+      },
+    })
+  })
+
+  it('has no accessibility violations', async () => {
+    const view = await visitView('/personal-setting/out-of-office')
+    const results = await axe(view.html())
+    expect(results).toHaveNoViolations()
+  })
+})