Skip to content

Commit 4affb36

Browse files
committed
Clarify hover test implementation comments
Add explanatory comments to hover interaction tests: - Explain .first() usage (axe-core may produce non-unique selectors) - Clarify mouse.move(0,0) intent (clear hover state) Tests verify integration (hover triggers highlight) not selector uniqueness.
1 parent a00be0c commit 4affb36

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,12 @@ test.describe('Dashboard axe — offcanvas interaction and highlight', () => {
280280
await target.hover();
281281

282282
// The corresponding element in the dashboard should get highlight class
283-
// Use .first() since selector may match multiple elements
283+
// Use .first() since axe-core may produce non-unique selectors (e.g., "span").
284+
// This tests integration (hover triggers highlight) not selector uniqueness.
284285
const element = page.locator(selector).first();
285286
await expect(element).toHaveClass(/quarto-axe-hover-highlight/, { timeout: 3000 });
286287

287-
// Move mouse away — highlight should be removed
288+
// Move mouse to top-left corner (away from all elements) to clear hover state
288289
await page.mouse.move(0, 0);
289290
await expect(element).not.toHaveClass(/quarto-axe-hover-highlight/);
290291
});
@@ -308,11 +309,12 @@ test.describe('HTML axe — hover interaction and highlight', () => {
308309
await target.hover();
309310

310311
// The corresponding element on the page should get highlight class
311-
// Use .first() since selector may match multiple elements (e.g., "span")
312+
// Use .first() since axe-core may produce non-unique selectors (e.g., "span").
313+
// This tests integration (hover triggers highlight) not selector uniqueness.
312314
const element = page.locator(selector).first();
313315
await expect(element).toHaveClass(/quarto-axe-hover-highlight/, { timeout: 3000 });
314316

315-
// Move mouse away — highlight should be removed
317+
// Move mouse to top-left corner (away from all elements) to clear hover state
316318
await page.mouse.move(0, 0);
317319
await expect(element).not.toHaveClass(/quarto-axe-hover-highlight/);
318320
});

0 commit comments

Comments
 (0)