Apply theme toggle to sidebar drawer

This commit is contained in:
2026-08-05 15:43:40 +02:00
parent 902f1927a2
commit 1914c7d141
3 changed files with 26 additions and 1 deletions
+3
View File
@@ -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/);