Files
radicle-explorer/tests/e2e/theme.spec.ts
T
Rūdolfs Ošiņš 086afbb5dc Give each e2e test its own reliable peer
The page always talked to the shared palm backend, so tests couldn't set
up peers of their own. Peers now have no passphrase by default, so tests
don't need an ssh-agent and test keys stay out of the developer's agent.
Fixtures wait for replication instead of relying on gossip timing, and a
request cancelled by a reload no longer counts as a page error.
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("/repos");
await expect(page.locator("html")).toHaveAttribute("data-theme", "dark");
});
test("theme persistence", async ({ page }) => {
await page.goto("/repos");
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("/repos");
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");
});