Skip to content

Commit e346d83

Browse files
committed
Update a11y.spec.ts
1 parent c1f52f2 commit e346d83

File tree

1 file changed

+34
-29
lines changed

1 file changed

+34
-29
lines changed

test/nuxt/a11y.spec.ts

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,11 +1944,23 @@ describe('component accessibility audits', () => {
19441944
props: {
19451945
packageName: 'array-includes',
19461946
replacement: {
1947+
id: 'Array.prototype.includes',
19471948
type: 'native',
1948-
moduleName: 'array-includes',
1949-
nodeVersion: '6.0.0',
1950-
replacement: 'Array.prototype.includes',
1951-
mdnPath: 'Global_Objects/Array/includes',
1949+
url: {
1950+
type: 'mdn',
1951+
id: 'Web/JavaScript/Reference/Global_Objects/Array/includes',
1952+
},
1953+
webFeatureId: {
1954+
featureId: 'array-includes',
1955+
compatKey: 'javascript.builtins.Array.includes',
1956+
},
1957+
engines: [
1958+
{ engine: 'chrome', minVersion: '47' },
1959+
{ engine: 'edge', minVersion: '14' },
1960+
{ engine: 'firefox', minVersion: '43' },
1961+
{ engine: 'safari', minVersion: '9' },
1962+
{ engine: 'nodejs', minVersion: '6.0.0' },
1963+
],
19521964
},
19531965
variant: 'nodep',
19541966
},
@@ -1962,9 +1974,10 @@ describe('component accessibility audits', () => {
19621974
props: {
19631975
packageName: 'is-even',
19641976
replacement: {
1977+
id: 'snippet::is-even',
19651978
type: 'simple',
1966-
moduleName: 'is-even',
1967-
replacement: 'Use (n % 2) === 0',
1979+
description: 'You can use the modulo operator to check if a number is even.',
1980+
example: '(n % 2) === 0',
19681981
},
19691982
variant: 'nodep',
19701983
},
@@ -1978,9 +1991,10 @@ describe('component accessibility audits', () => {
19781991
props: {
19791992
packageName: 'moment',
19801993
replacement: {
1994+
id: 'day.js',
19811995
type: 'documented',
1982-
moduleName: 'moment',
1983-
docPath: 'moment',
1996+
url: { type: 'e18e', id: 'moment' },
1997+
replacementModule: 'day.js',
19841998
},
19851999
variant: 'info',
19862000
},
@@ -2403,12 +2417,16 @@ describe('component accessibility audits', () => {
24032417
const component = await mountSuspended(PackageReplacement, {
24042418
props: {
24052419
replacement: {
2420+
id: 'Array.prototype.every',
24062421
type: 'native',
2407-
moduleName: 'array-every',
2408-
nodeVersion: '0.10.0',
2409-
replacement: 'Array.prototype.every',
2410-
mdnPath: 'Global_Objects/Array/every',
2411-
category: 'native',
2422+
url: {
2423+
type: 'mdn',
2424+
id: 'Web/JavaScript/Reference/Global_Objects/Array/every',
2425+
},
2426+
engines: [
2427+
{ engine: 'nodejs', minVersion: '0.10.0' },
2428+
{ engine: 'chrome', minVersion: '1' },
2429+
],
24122430
},
24132431
},
24142432
})
@@ -2420,23 +2438,10 @@ describe('component accessibility audits', () => {
24202438
const component = await mountSuspended(PackageReplacement, {
24212439
props: {
24222440
replacement: {
2441+
id: 'snippet::is-even',
24232442
type: 'simple',
2424-
moduleName: 'underscore',
2425-
replacement: 'lodash',
2426-
},
2427-
},
2428-
})
2429-
const results = await runAxe(component)
2430-
expect(results.violations).toEqual([])
2431-
})
2432-
2433-
it('should have no accessibility violations for documented replacement', async () => {
2434-
const component = await mountSuspended(PackageReplacement, {
2435-
props: {
2436-
replacement: {
2437-
type: 'documented',
2438-
moduleName: 'moment',
2439-
docPath: 'moment',
2443+
description: 'You can use the modulo operator to check if a number is even.',
2444+
example: '(n % 2) === 0',
24402445
},
24412446
},
24422447
})

0 commit comments

Comments
 (0)