forked from baron/baron-sso
조직도 M2M조회 추가, 자동로그인 보완
This commit is contained in:
39
devfront/tests/devfront-login.spec.ts
Normal file
39
devfront/tests/devfront-login.spec.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.describe("DevFront login", () => {
|
||||
test("shows a clear error instead of silently failing when PKCE cannot run", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.addInitScript(() => {
|
||||
Object.defineProperty(window, "isSecureContext", {
|
||||
configurable: true,
|
||||
value: false,
|
||||
});
|
||||
});
|
||||
|
||||
let authorizeRequested = false;
|
||||
await page.route("**/oidc/.well-known/openid-configuration", async (route) => {
|
||||
await route.fulfill({
|
||||
json: {
|
||||
issuer: "http://localhost:5000/oidc",
|
||||
authorization_endpoint: "http://localhost:5000/oidc/oauth2/auth",
|
||||
token_endpoint: "http://localhost:5000/oidc/oauth2/token",
|
||||
jwks_uri: "http://localhost:5000/oidc/.well-known/jwks.json",
|
||||
},
|
||||
headers: { "Access-Control-Allow-Origin": "*" },
|
||||
});
|
||||
});
|
||||
await page.route("**/oidc/oauth2/auth**", async (route) => {
|
||||
authorizeRequested = true;
|
||||
await route.fulfill({ status: 500, body: "unexpected authorize request" });
|
||||
});
|
||||
|
||||
await page.goto("/login");
|
||||
await page.getByRole("button", { name: "SSO 계정으로 로그인" }).click();
|
||||
|
||||
await expect(page.getByRole("alert")).toContainText(
|
||||
"HTTPS 또는 localhost",
|
||||
);
|
||||
expect(authorizeRequested).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user