|
1 | 1 | import { mountSuspended } from '@nuxt/test-utils/runtime' |
2 | | -import 'axe-core' |
3 | | -import type { AxeResults, RunOptions } from 'axe-core' |
4 | 2 | import { afterEach, describe, expect, it } from 'vitest' |
5 | 3 | import { CommandPalette } from '#components' |
6 | 4 |
|
7 | | -declare const axe: { |
8 | | - run: (context: Element, options?: RunOptions) => Promise<AxeResults> |
9 | | -} |
10 | | - |
11 | | -const axeRunOptions: RunOptions = { |
12 | | - resultTypes: ['violations'], |
13 | | - rules: { |
14 | | - 'landmark-one-main': { enabled: false }, |
15 | | - 'region': { enabled: false }, |
16 | | - 'page-has-heading-one': { enabled: false }, |
17 | | - 'landmark-no-duplicate-banner': { enabled: false }, |
18 | | - 'landmark-no-duplicate-contentinfo': { enabled: false }, |
19 | | - 'landmark-no-duplicate-main': { enabled: false }, |
20 | | - }, |
21 | | -} |
22 | | - |
23 | 5 | let commandPalette: ReturnType<typeof useCommandPalette> | null = null |
24 | 6 |
|
25 | 7 | const CommandPaletteHarness = defineComponent({ |
@@ -47,18 +29,6 @@ afterEach(() => { |
47 | 29 | }) |
48 | 30 |
|
49 | 31 | describe('CommandPalette', () => { |
50 | | - it('has no accessibility violations when open', async () => { |
51 | | - await mountSuspended(CommandPaletteHarness) |
52 | | - await nextTick() |
53 | | - await nextTick() |
54 | | - |
55 | | - const dialog = document.getElementById('command-palette-modal') |
56 | | - expect(dialog).not.toBeNull() |
57 | | - |
58 | | - const results = await axe.run(dialog!, axeRunOptions) |
59 | | - expect(results.violations).toEqual([]) |
60 | | - }) |
61 | | - |
62 | 32 | it('connects the input to an existing description, live status, and results region', async () => { |
63 | 33 | await mountSuspended(CommandPaletteHarness) |
64 | 34 | await nextTick() |
|
0 commit comments