personal-setting-avatar-a11y.spec.ts 1.0 KB

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 { waitForNextTick } from '#tests/support/utils.ts'
  5. describe('testing avatar a11y view', async () => {
  6. it('has no accessibility violations', async () => {
  7. await visitView('/personal-setting/avatar')
  8. const results = await axe(document.body)
  9. expect(results).toHaveNoViolations()
  10. })
  11. // TODO: some accessibility needs to be fixed.
  12. it.skip('has no accessibility violations with upload new avatar by file flyout', async () => {
  13. const view = await visitView('/personal-setting/avatar')
  14. const file = new File([], 'test.jpg', { type: 'image/jpeg' })
  15. await view.events.upload(view.getByTestId('fileUploadInput'), file)
  16. await waitForNextTick()
  17. await view.findByRole('complementary', {
  18. name: 'Crop Image',
  19. })
  20. const results = await axe(document.body)
  21. expect(results).toHaveNoViolations()
  22. })
  23. })