forked from baron/baron-sso
36 lines
1008 B
TypeScript
36 lines
1008 B
TypeScript
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,
|
|
});
|
|
});
|
|
});
|