Files
CPLv4.0/playwright/tests/components/header/headerTest.ts
2025-09-11 08:38:00 +02:00

22 lines
719 B
TypeScript

import { Page, expect } from "@playwright/test";
/**
* Reusable header assertions.
* Add more checks here if the header grows (logout button, admin badge etc.).
*/
export async function headerTest(page: Page) {
// Haupttitel
await expect(
page.getByRole("heading", { name: "Meldestation" })
).toBeVisible();
// Logo (alt="Logo")
await expect(
page.getByRole("img", { name: "Logo", exact: true })
).toBeVisible();
// Talas Logo
await expect(page.getByRole("img", { name: "TALAS Logo" })).toBeVisible();
// Theme Toggle (Label wechselt Dark/Light). Wir akzeptieren beide.
const darkBtn = page.getByRole("button", { name: /Dark Mode|Light Mode/ });
await expect(darkBtn).toBeVisible();
}