Skip to content

Commit 81ae702

Browse files
committed
fix: Ignore axe version when checking 'problemUrl', so axe version updates don’t fail our tests
1 parent 43e5a8f commit 81ae702

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tests/site-with-errors.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ describe("site-with-errors", () => {
1717

1818
it("cache has expected results", () => {
1919
const actual = results.map(({ issue: { url: issueUrl }, pullRequest: { url: pullRequestUrl }, findings }) => {
20-
const { solutionLong, ...finding } = findings[0];
20+
const { problemUrl, solutionLong, ...finding } = findings[0];
2121
// Check volatile fields for existence only
2222
expect(issueUrl).toBeDefined();
2323
expect(pullRequestUrl).toBeDefined();
24+
expect(problemUrl).toBeDefined();
2425
expect(solutionLong).toBeDefined();
26+
// Check `problemUrl`, ignoring axe version
27+
expect(problemUrl.startsWith("https://dequeuniversity.com/rules/axe/")).toBe(true);
28+
expect(problemUrl.endsWith(`/${finding.ruleId}?application=playwright`)).toBe(true);
2529
return finding;
2630
});
2731
const expected = [
@@ -30,15 +34,13 @@ describe("site-with-errors", () => {
3034
url: "http://127.0.0.1:4000/",
3135
html: '<span class="post-meta">Jul 30, 2025</span>',
3236
problemShort: "elements must meet minimum color contrast ratio thresholds",
33-
problemUrl: "https://dequeuniversity.com/rules/axe/4.10/color-contrast?application=playwright",
3437
ruleId: "color-contrast",
3538
solutionShort: "ensure the contrast between foreground and background colors meets wcag 2 aa minimum contrast ratio thresholds"
3639
}, {
3740
scannerType: "axe",
3841
url: "http://127.0.0.1:4000/",
3942
html: '<html lang="en">',
4043
problemShort: "page should contain a level-one heading",
41-
problemUrl: "https://dequeuniversity.com/rules/axe/4.10/page-has-heading-one?application=playwright",
4244
ruleId: "page-has-heading-one",
4345
solutionShort: "ensure that the page, or at least one of its frames contains a level-one heading"
4446
}, {
@@ -47,31 +49,27 @@ describe("site-with-errors", () => {
4749
html: `<time class="dt-published" datetime="2025-07-30T17:32:33+00:00" itemprop="datePublished">Jul 30, 2025
4850
</time>`,
4951
problemShort: "elements must meet minimum color contrast ratio thresholds",
50-
problemUrl: "https://dequeuniversity.com/rules/axe/4.10/color-contrast?application=playwright",
5152
ruleId: "color-contrast",
5253
solutionShort: "ensure the contrast between foreground and background colors meets wcag 2 aa minimum contrast ratio thresholds",
5354
}, {
5455
scannerType: "axe",
5556
url: "http://127.0.0.1:4000/about/",
5657
html: '<a href="https://jekyllrb.com/">jekyllrb.com</a>',
5758
problemShort: "elements must meet minimum color contrast ratio thresholds",
58-
problemUrl: "https://dequeuniversity.com/rules/axe/4.10/color-contrast?application=playwright",
5959
ruleId: "color-contrast",
6060
solutionShort: "ensure the contrast between foreground and background colors meets wcag 2 aa minimum contrast ratio thresholds",
6161
}, {
6262
scannerType: "axe",
6363
url: "http://127.0.0.1:4000/404.html",
6464
html: '<li class="p-name">Accessibility Scanner Demo</li>',
6565
problemShort: "elements must meet minimum color contrast ratio thresholds",
66-
problemUrl: "https://dequeuniversity.com/rules/axe/4.10/color-contrast?application=playwright",
6766
ruleId: "color-contrast",
6867
solutionShort: "ensure the contrast between foreground and background colors meets wcag 2 aa minimum contrast ratio thresholds"
6968
}, {
7069
scannerType: "axe",
7170
url: "http://127.0.0.1:4000/404.html",
7271
html: '<h1 class="post-title"></h1>',
7372
problemShort: "headings should not be empty",
74-
problemUrl: "https://dequeuniversity.com/rules/axe/4.10/empty-heading?application=playwright",
7573
ruleId: "empty-heading",
7674
solutionShort: "ensure headings have discernible text",
7775
},

0 commit comments

Comments
 (0)