Files
suaveplan/apps/testbed/e2e/layout/theme.spec.ts
2026-05-27 23:29:53 +01:00

22 lines
894 B
TypeScript

import { test, expect } from "@playwright/test";
test.describe("Theme Toggle", () => {
test("theme toggle button is visible in header", async ({ page }) => {
await page.goto("/");
await expect(page.locator('[data-testid="header"]')).toBeVisible();
// The theme toggle button should be in the header
const themeToggle = page.locator('[data-testid="theme-toggle"]');
// If the component uses a different testid, try the button within header
const headerBtns = page.locator('[data-testid="header"] button');
const btnCount = await headerBtns.count();
expect(btnCount).toBeGreaterThan(0);
});
test("page loads without dark class by default", async ({ page }) => {
await page.goto("/");
// Default should not have dark mode active unless system preference is dark
const html = page.locator("html");
await expect(html).toBeVisible();
});
});