1
0
forked from baron/baron-sso

af 린트 적용

This commit is contained in:
2026-02-24 11:02:30 +09:00
parent c4d3a9f7a1
commit 6a7676f95c
6 changed files with 39 additions and 22 deletions

View File

@@ -4,14 +4,16 @@ test.describe("Auth Flow", () => {
test("unauthenticated user is redirected to login", async ({ page }) => {
// Navigate to a protected route without setting localStorage
await page.goto("/");
// Check if it redirects to login
await expect(page).toHaveURL(/\/login$/);
// Verify login page content
await expect(page.getByText("Baron SSO")).toBeVisible();
await expect(page.getByText("관리자 로그인")).toBeVisible();
await expect(page.getByRole("button", { name: "SSO 계정으로 로그인" })).toBeVisible();
await expect(
page.getByRole("button", { name: "SSO 계정으로 로그인" }),
).toBeVisible();
});
test("authenticated user can access dashboard", async ({ page }) => {
@@ -19,9 +21,9 @@ test.describe("Auth Flow", () => {
await page.addInitScript(() => {
window.localStorage.setItem("admin_session", "playwright-admin-session");
});
await page.goto("/");
// Should stay on dashboard (or another protected route) and not redirect to login
await expect(page).not.toHaveURL(/\/login$/);
});