evcc-io/tests/custom-css.spec.ts
Maschga d43ab9fa6a
chore: Typescript: Rewrite tests (#21723)
Co-authored-by: Michael Geers <michael@geers.tv>
2025-06-15 23:23:22 +02:00

23 lines
665 B
TypeScript

import { test, expect } from "@playwright/test";
import { start, stop, baseUrl } from "./evcc";
test.use({ baseURL: baseUrl() });
test.beforeAll(async () => {
await start("basics.evcc.yaml", null, ["--disable-auth", "--custom-css", "tests/custom-css.css"]);
});
test.afterAll(async () => {
await stop();
});
test.describe("custom-css", async () => {
test("header and footer are hidden", async ({ page }) => {
page.on("dialog", () => {
throw new Error("XSS: inline script detected");
});
await page.goto("/");
await expect(page.getByTestId("header")).toBeHidden();
await expect(page.getByTestId("footer")).toBeHidden();
});
});