chore(repo): initialize planarchy workspace
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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@planarchy.dev");
|
||||
await page.fill('input[type="password"]', "admin123");
|
||||
await page.click('button[type="submit"]');
|
||||
await expect(page).toHaveURL(/\/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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user