Skip to content

Commit 536f088

Browse files
committed
test: update axe tests to expect image-alt instead of link-name
The link-name violation from the slide-menu button is now fixed, so revealjs axe tests need a different violation to detect. Add an unlabeled img to the console and json fixtures (matching the document fixtures) and switch expectedViolation to image-alt.
1 parent bb710a2 commit 536f088

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

tests/docs/playwright/revealjs/axe-console.qmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ This text violates contrast rules: [insufficient contrast.]{style="color: #eee;
1313
## Slide 2
1414

1515
More content to check.
16+
17+
<img src="placeholder.png" class="axe-test-img">

tests/docs/playwright/revealjs/axe-json.qmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ This text violates contrast rules: [insufficient contrast.]{style="color: #eee;
1414
## Slide 2
1515

1616
More content to check.
17+
18+
<img src="placeholder.png" class="axe-test-img">

tests/integration/playwright/tests/axe-accessibility.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ const testCases: AxeTestCase[] = [
5050

5151
// RevealJS — axe-check.js loads as standalone module (#13781).
5252
// RevealJS CSS transforms prevent axe-core from computing color contrast,
53-
// so we check for link-name (slide-menu-button has unlabeled <a>).
53+
// so we check for image-alt (unlabeled <img> on Slide 2).
5454
{ format: 'revealjs', outputMode: 'document', url: '/revealjs/axe-accessibility.html',
55-
expectedViolation: 'link-name' },
55+
expectedViolation: 'image-alt' },
5656
{ format: 'revealjs', outputMode: 'console', url: '/revealjs/axe-console.html',
57-
expectedViolation: 'link-name' },
57+
expectedViolation: 'image-alt' },
5858
{ format: 'revealjs', outputMode: 'json', url: '/revealjs/axe-json.html',
59-
expectedViolation: 'link-name' },
59+
expectedViolation: 'image-alt' },
6060

6161
// RevealJS dark theme — verifies CSS custom property bridge for theming.
6262
// Report should use --r-background-color/#191919, not the Sass fallback #fff.
6363
{ format: 'revealjs-dark', outputMode: 'document', url: '/revealjs/axe-accessibility-dark.html',
64-
expectedViolation: 'link-name' },
64+
expectedViolation: 'image-alt' },
6565

6666
// Dashboard — axe-check.js loads as standalone module, falls back to document.body (#13781)
6767
{ format: 'dashboard', outputMode: 'document', url: '/dashboard/axe-accessibility.html',

0 commit comments

Comments
 (0)