Skip to content

Commit 035975f

Browse files
committed
Update tests
1 parent 51b0cc5 commit 035975f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/site-with-errors.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ describe('site-with-errors', () => {
1616
})
1717

1818
it('cache has expected results', () => {
19-
const actual = results.map(({issue: {url: issueUrl}, pullRequest: {url: pullRequestUrl}, findings}) => {
19+
const actual = results.map(;({issue: {url: issueUrl}, pullRequest: {url: pullRequestUrl}, findings}) => {
2020
const {problemUrl, solutionLong, screenshotId, ...finding} = findings[0]
2121
// Check volatile fields for existence only
2222
expect(issueUrl).toBeDefined()
2323
expect(pullRequestUrl).toBeDefined()
2424
expect(problemUrl).toBeDefined()
2525
expect(solutionLong).toBeDefined()
26-
expect(screenshotId).toBeDefined()
2726
// Check `problemUrl`, ignoring axe version
2827
expect(problemUrl.startsWith('https://dequeuniversity.com/rules/axe/')).toBe(true)
2928
expect(problemUrl.endsWith(`/${finding.ruleId}?application=playwright`)).toBe(true)
30-
expect(screenshotId).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/)
29+
// screenshotId is only present when include_screenshots is enabled
30+
if (screenshotId !== undefined) {
31+
expect(screenshotId).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/)
32+
}
3133
return finding
3234
})
3335
const expected = [

0 commit comments

Comments
 (0)