fix(menu): prevent mobile dropdown click from auto-focusing search
This commit is contained in:
21
tests/mobile-menu-focus.spec.ts
Normal file
21
tests/mobile-menu-focus.spec.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test("clicking mobile hamburger does not focus the sidebar search input", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.setViewportSize({ width: 375, height: 812 });
|
||||
await page.goto("/", { waitUntil: "load" });
|
||||
|
||||
const menuButton = page.locator(".hextra-hamburger-menu");
|
||||
await expect(menuButton).toBeVisible();
|
||||
|
||||
const sidebarSearchInput = page
|
||||
.locator(".hextra-sidebar-container .hextra-search-input")
|
||||
.first();
|
||||
await expect(sidebarSearchInput).toBeVisible();
|
||||
|
||||
await menuButton.click();
|
||||
|
||||
await expect(menuButton).toHaveAttribute("aria-expanded", "true");
|
||||
await expect(sidebarSearchInput).not.toBeFocused();
|
||||
});
|
||||
Reference in New Issue
Block a user