forked from baron/baron-sso
af 린트 적용
This commit is contained in:
@@ -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$/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user