test: add playwright e2e test setup with smoke tests

This commit is contained in:
2026-06-24 16:10:07 +02:00
committed by Milas Holsting
parent dbc675d79b
commit 4ecd9599c7
7 changed files with 72 additions and 1 deletions

23
tests/e2e/smoke.e2e.ts Normal file
View File

@@ -0,0 +1,23 @@
import { expect, test } from "@playwright/test";
test("redirects protected pages to login", async ({ page }) => {
const response = await page.goto("/");
expect(response?.status()).toBeLessThan(400);
await expect(page).toHaveURL(/\/login$/u);
});
test("renders the login page", async ({ page }) => {
await page.goto("/login");
await expect(page.getByRole("textbox", { name: /email address/iu })).toBeVisible();
await expect(page.locator('input[name="password"]')).toBeVisible();
await expect(page.getByRole("button", { name: /sign in/iu })).toBeVisible();
});
test("serves static assets without authentication", async ({ request }) => {
const response = await request.get("/dist/tailwind.css");
expect(response.status()).toBe(200);
expect(response.headers()["content-type"]).toContain("text/css");
});