Let the theme be chosen by clicking its label in the profile menu
Clicking a theme option's text moved focus nowhere, and the focusout rule closed the panel before the radio was checked. The panel now closes only when focus moves to an element outside it; clicks outside and Escape still close it. Each theme option is a full-width row with a hover state, and the chosen one is also shown in bold. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -27,6 +27,16 @@ it('opens and closes the profile menu with the keyboard', function () {
|
||||
->assertScript('document.activeElement.hasAttribute("data-profile-menu")', true);
|
||||
});
|
||||
|
||||
it('chooses the theme by clicking the text of an option', function () {
|
||||
visit(route('customers.index'))->inLightMode()
|
||||
->click(PROFILE_MENU)
|
||||
->click('#profile-menu-panel label:has([data-theme-option="dark"])')
|
||||
->assertScript('document.documentElement.classList.contains("dark")', true)
|
||||
->assertChecked('[data-theme-option="dark"]')
|
||||
->assertAttribute(PROFILE_MENU, 'aria-expanded', 'true')
|
||||
->assertVisible('#profile-menu-panel');
|
||||
});
|
||||
|
||||
it('changes the language from the profile menu', function () {
|
||||
$page = visit(route('customers.index'))->inLightMode()
|
||||
->click(PROFILE_MENU)
|
||||
|
||||
Reference in New Issue
Block a user