forked from baron/baron-sso
devfront 개발모드 unkown로그인 제거
This commit is contained in:
35
devfront/tests/devfront-login-guard.spec.ts
Normal file
35
devfront/tests/devfront-login-guard.spec.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.describe("DevFront login guard", () => {
|
||||
test("shows the login screen instead of restoring an unknown placeholder session", async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
await page.addInitScript(() => {
|
||||
window.localStorage.setItem(
|
||||
"oidc.user:http://localhost:5000/oidc:devfront",
|
||||
JSON.stringify({
|
||||
expires_at: Math.floor(Date.now() / 1000) + 3600,
|
||||
profile: {
|
||||
name: "Unknown User",
|
||||
email: "unknown@example.com",
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
await page.goto("/clients");
|
||||
|
||||
await expect(
|
||||
page.getByRole("heading", { name: "Baron SSO" }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "SSO 계정으로 로그인" }),
|
||||
).toBeVisible();
|
||||
await expect(page.getByText("unknown@example.com")).toHaveCount(0);
|
||||
|
||||
await page.screenshot({
|
||||
path: testInfo.outputPath("login-screen.png"),
|
||||
fullPage: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user