Skip to content

Commit 79d3cfa

Browse files
committed
Updates site with errors test
1 parent d250560 commit 79d3cfa

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

tests/site-with-errors.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ describe('site-with-errors', () => {
3838
})
3939

4040
it('cache has expected results', () => {
41-
const actual = results.map(;({issue: {url: issueUrl}, findings}) => {
41+
const actual = results.map(({issue: {url: issueUrl}, findings}) => {
4242
const {problemUrl, solutionLong, screenshotId, ...finding} = findings[0]
4343
// Check volatile fields for existence only
4444
expect(issueUrl).toBeDefined()
4545
expect(problemUrl).toBeDefined()
46-
// solutionLong is optional for non-axe scans
46+
// Axe-specific assertions
4747
if (finding.scannerType === 'axe') {
4848
expect(solutionLong).toBeDefined()
49+
expect(problemUrl.startsWith('https://dequeuniversity.com/rules/axe/')).toBe(true)
50+
expect(problemUrl.endsWith(`/${finding.ruleId}?application=playwright`)).toBe(true)
4951
}
5052
// screenshotId is only present when include_screenshots is enabled
5153
if (screenshotId !== undefined) {
@@ -108,11 +110,10 @@ describe('site-with-errors', () => {
108110
solutionShort: 'ensure headings have discernible text',
109111
},
110112
{
111-
scannerType: 'reflow',
113+
scannerType: 'reflow-scan',
112114
url: 'http://127.0.0.1:4000/404.html',
113-
problemShort: 'Page requires horizontal scrolling at 320x256 viewport',
114-
solutionShort: 'Ensure content is responsive and does not require horizontal scrolling at small viewport sizes',
115-
problemUrl: 'https://www.w3.org/WAI/WCAG21/Understanding/reflow.html',
115+
problemShort: 'page requires horizontal scrolling at 320x256 viewport',
116+
solutionShort: 'ensure content is responsive and does not require horizontal scrolling at small viewport sizes',
116117
},
117118
]
118119
// Check that:

0 commit comments

Comments
 (0)