mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-03 18:50:30 +08:00
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.
33 lines
1.2 KiB
TypeScript
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");
|
|
});
|