Skip to content

Commit 0826806

Browse files
committed
test: add a11y tests for tags
1 parent c51fb34 commit 0826806

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

test/nuxt/a11y.spec.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ import {
111111
SettingsAccentColorPicker,
112112
SettingsBgThemePicker,
113113
SettingsToggle,
114+
TagStatic,
115+
TagClickable,
114116
TerminalExecute,
115117
TerminalInstall,
116118
TooltipAnnounce,
@@ -232,6 +234,44 @@ describe('component accessibility audits', () => {
232234
})
233235
})
234236

237+
describe('TagStatic', () => {
238+
it('should have no accessibility violations', async () => {
239+
const component = await mountSuspended(TagStatic, {
240+
slots: { default: 'Tag content' },
241+
})
242+
const results = await runAxe(component)
243+
expect(results.violations).toEqual([])
244+
})
245+
})
246+
247+
describe('TagClickable', () => {
248+
it('should have no accessibility violations', async () => {
249+
const component = await mountSuspended(TagClickable, {
250+
slots: { default: 'Tag content' },
251+
})
252+
const results = await runAxe(component)
253+
expect(results.violations).toEqual([])
254+
})
255+
256+
it('should have no accessibility violationst for active state', async () => {
257+
const component = await mountSuspended(TagClickable, {
258+
props: { status: 'active' },
259+
slots: { default: 'Tag content' },
260+
})
261+
const results = await runAxe(component)
262+
expect(results.violations).toEqual([])
263+
})
264+
265+
it('should have no accessibility violationst for disabled state', async () => {
266+
const component = await mountSuspended(TagClickable, {
267+
props: { disabled: true },
268+
slots: { default: 'Tag content' },
269+
})
270+
const results = await runAxe(component)
271+
expect(results.violations).toEqual([])
272+
})
273+
})
274+
235275
describe('TooltipApp', () => {
236276
it('should have no accessibility violations', async () => {
237277
const component = await mountSuspended(TooltipApp, {

0 commit comments

Comments
 (0)