Apply theme toggle to sidebar drawer
This commit is contained in:
@@ -50,10 +50,13 @@ test("left controls open in a responsive sidebar drawer", async ({ page }) => {
|
||||
test("theme toggle switches and persists dark mode", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await expect(page.locator("html")).not.toHaveClass(/dark/);
|
||||
const lightPanelBackground = await page.locator("#sidebarDrawer").evaluate((element) => getComputedStyle(element).backgroundColor);
|
||||
|
||||
await page.locator("#themeToggle").click();
|
||||
await expect(page.locator("html")).toHaveClass(/dark/);
|
||||
await expect(page.locator("#themeToggle")).toHaveText("Light theme");
|
||||
const darkPanelBackground = await page.locator("#sidebarDrawer").evaluate((element) => getComputedStyle(element).backgroundColor);
|
||||
expect(darkPanelBackground).not.toBe(lightPanelBackground);
|
||||
|
||||
await page.reload();
|
||||
await expect(page.locator("html")).toHaveClass(/dark/);
|
||||
|
||||
Reference in New Issue
Block a user