Skip to content

Commit a8bd099

Browse files
committed
test: add a11y test for UserAvatar
1 parent e8e8064 commit a8bd099

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/nuxt/a11y.spec.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ afterEach(() => {
5757
import {
5858
AppFooter,
5959
AppHeader,
60+
UserAvatar,
6061
BuildEnvironment,
6162
CallToAction,
6263
CodeDirectoryListing,
@@ -1794,4 +1795,30 @@ describe('component accessibility audits', () => {
17941795
expect(results.violations).toEqual([])
17951796
})
17961797
})
1798+
1799+
describe('UserAvatar', () => {
1800+
it('should have no accessibility violations', async () => {
1801+
const component = await mountSuspended(UserAvatar, {
1802+
props: { username: 'testuser' },
1803+
})
1804+
const results = await runAxe(component)
1805+
expect(results.violations).toEqual([])
1806+
})
1807+
1808+
it('should have no accessibility violations with short username', async () => {
1809+
const component = await mountSuspended(UserAvatar, {
1810+
props: { username: 'a' },
1811+
})
1812+
const results = await runAxe(component)
1813+
expect(results.violations).toEqual([])
1814+
})
1815+
1816+
it('should have no accessibility violations with long username', async () => {
1817+
const component = await mountSuspended(UserAvatar, {
1818+
props: { username: 'verylongusernameexample' },
1819+
})
1820+
const results = await runAxe(component)
1821+
expect(results.violations).toEqual([])
1822+
})
1823+
})
17971824
})

0 commit comments

Comments
 (0)