Add persistent dark theme toggle

This commit is contained in:
2026-08-05 13:15:03 +02:00
parent c1c63043c8
commit a88ca99697
5 changed files with 72 additions and 1 deletions
+12
View File
@@ -30,3 +30,15 @@ test("catalog maker remains usable on a narrow viewport", async ({ page }) => {
await expect(page.locator("#settingsButton")).toBeVisible();
await page.screenshot({ path: "test-results/catalog-maker-mobile.png", fullPage: true });
});
test("theme toggle switches and persists dark mode", async ({ page }) => {
await page.goto("/");
await expect(page.locator("html")).not.toHaveClass(/dark/);
await page.locator("#themeToggle").click();
await expect(page.locator("html")).toHaveClass(/dark/);
await expect(page.locator("#themeToggle")).toHaveText("Light theme");
await page.reload();
await expect(page.locator("html")).toHaveClass(/dark/);
});