Skip to content

Commit 7353481

Browse files
committed
chore: a11y test
1 parent 3dfc0aa commit 7353481

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/nuxt/a11y.spec.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ import {
178178
PackageChartModal,
179179
PackageClaimPackageModal,
180180
PackageCompatibility,
181+
PackageQualityScore,
181182
PackageDependencies,
182183
PackageDeprecatedTree,
183184
PackageHeader,
@@ -1126,6 +1127,34 @@ describe('component accessibility audits', () => {
11261127
})
11271128
})
11281129

1130+
describe('PackageQualityScore', () => {
1131+
it('should have no accessibility violations', async () => {
1132+
const component = await mountSuspended(PackageQualityScore, {
1133+
props: {
1134+
score: {
1135+
percentage: 85,
1136+
totalPoints: 12,
1137+
maxPoints: 14,
1138+
checks: [
1139+
{ id: 'has-readme', category: 'documentation', points: 2, maxPoints: 2 },
1140+
{ id: 'has-description', category: 'documentation', points: 1, maxPoints: 1 },
1141+
{ id: 'update-frequency', category: 'maintenance', points: 2, maxPoints: 2 },
1142+
{ id: 'has-types', category: 'types', points: 1, maxPoints: 2 },
1143+
{ id: 'has-license', category: 'bestPractices', points: 1, maxPoints: 1 },
1144+
{ id: 'has-repository', category: 'bestPractices', points: 1, maxPoints: 1 },
1145+
{ id: 'has-provenance', category: 'bestPractices', points: 0, maxPoints: 1 },
1146+
{ id: 'has-esm', category: 'bestPractices', points: 1, maxPoints: 1 },
1147+
{ id: 'no-vulnerabilities', category: 'security', points: 2, maxPoints: 2 },
1148+
{ id: 'not-deprecated', category: 'security', points: 1, maxPoints: 1 },
1149+
],
1150+
},
1151+
},
1152+
})
1153+
const results = await runAxe(component)
1154+
expect(results.violations).toEqual([])
1155+
})
1156+
})
1157+
11291158
describe('PackageKeywords', () => {
11301159
it('should have no accessibility violations without keywords', async () => {
11311160
const component = await mountSuspended(PackageKeywords, {

0 commit comments

Comments
 (0)