Expect the section picker to mark its page, not a checked item
The browser test still looked for the menuitemcheckbox the picker drew before it marked the current section with aria-current. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RHoXZSHc8gGpZjFmA5fPc2
This commit is contained in:
co-authored by
Claude Opus 5
parent
a4bc046d1d
commit
a980f5b0d0
@@ -141,6 +141,7 @@ it('turns section tabs into a picker on a phone', function () {
|
|||||||
->assertScript("getComputedStyle(document.querySelector('[data-section-nav] nav')).display === 'none'")
|
->assertScript("getComputedStyle(document.querySelector('[data-section-nav] nav')).display === 'none'")
|
||||||
->click('[data-section-picker] button')
|
->click('[data-section-picker] button')
|
||||||
->assertScript("document.querySelector('[data-section-picker] [popover]').matches(':popover-open')")
|
->assertScript("document.querySelector('[data-section-picker] [popover]').matches(':popover-open')")
|
||||||
->assertAttribute('[data-section-picker] [role="menuitemcheckbox"][href="#profile"]', 'aria-checked', 'true')
|
// A menu of places: the current section is the page, not a checked choice.
|
||||||
->assertAttribute('[data-section-picker] [role="menuitemcheckbox"][href="#security"]', 'aria-checked', 'false');
|
->assertAttribute('[data-section-picker] [role="menuitem"][href="#profile"]', 'aria-current', 'page')
|
||||||
|
->assertScript("! document.querySelector('[data-section-picker] [role=\"menuitem\"][href=\"#security\"]').hasAttribute('aria-current')");
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user