Files
Nexus/apps/web/e2e/auth.spec.ts
T
Hartmut b41c1d2501
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61)
rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61)

Co-authored-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
Co-committed-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
2026-05-21 16:28:40 +02:00

25 lines
940 B
TypeScript

import { expect, test } from "@playwright/test";
test.describe("Authentication", () => {
test("redirects unauthenticated users to sign-in", async ({ page }) => {
await page.goto("/");
await expect(page).toHaveURL(/\/auth\/signin/);
});
test("admin can sign in", async ({ page }) => {
await page.goto("/auth/signin");
await page.fill('input[type="email"]', "admin@nexus.dev");
await page.fill('input[type="password"]', "admin123");
await page.click('button[type="submit"]');
await expect(page).toHaveURL(/\/(dashboard|resources)/);
});
test("shows error on invalid credentials", async ({ page }) => {
await page.goto("/auth/signin");
await page.fill('input[type="email"]', "wrong@example.com");
await page.fill('input[type="password"]', "wrongpass");
await page.click('button[type="submit"]');
await expect(page.locator("text=Invalid email or password")).toBeVisible();
});
});