Files
Rūdolfs Ošiņš 7728c9272e Start e2e specs at a route that exists
/repos is no longer a route, so specs fell back to the inbox and logged a
routing error. The inbox opens the first-launch guide, so tests now start
with it dismissed. The router now logs the URL it couldn't resolve
instead of just "URL".
2026-10-01 18:16:29 +02:00

33 lines
1.2 KiB
TypeScript

import { expect, reload, test } from "@tests/support/fixtures.js";
test("default theme", async ({ page }) => {
await page.goto("/inbox");
await expect(page.locator("html")).toHaveAttribute("data-theme", "dark");
});
test("theme persistence", async ({ page }) => {
await page.goto("/inbox");
await expect(page.getByRole("link", { name: "markdown" })).toBeVisible();
await page.getByRole("button", { name: "Settings" }).click();
await page.getByRole("button", { name: "Light", exact: true }).click();
await expect(page.locator("html")).toHaveAttribute("data-theme", "light");
await reload(page);
await expect(page.locator("html")).toHaveAttribute("data-theme", "light");
});
test("change theme", async ({ page }) => {
await page.goto("/inbox");
await expect(page.getByRole("link", { name: "markdown" })).toBeVisible();
await page.getByRole("button", { name: "Settings" }).click();
await page.getByRole("button", { name: "Light", exact: true }).click();
await expect(page.locator("html")).toHaveAttribute("data-theme", "light");
await page.getByRole("button", { name: "Dark", exact: true }).click();
await expect(page.locator("html")).toHaveAttribute("data-theme", "dark");
});