Initial Commit
This commit is contained in:
21
apps/testbed/e2e/layout/theme.spec.ts
Normal file
21
apps/testbed/e2e/layout/theme.spec.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user