1
0
forked from baron/baron-sso

커스텀 클레임 test 코드 추가

This commit is contained in:
2026-04-28 17:47:55 +09:00
parent 20afede89c
commit e484d8c100
2 changed files with 156 additions and 1 deletions

View File

@@ -129,6 +129,159 @@ test.describe("DevFront clients lifecycle", () => {
).toHaveValue(/https:\/\/after\.example\.com\/callback/);
});
test("id token claims should be persisted and restored", async ({ page }) => {
const state = {
clients: [
makeClient("client-claims", {
name: "Claims app",
metadata: {},
}),
],
consents: [] as Consent[],
auditLogsByCursor: undefined,
};
await installDevApiMock(page, state);
await page.goto("/clients/client-claims/settings");
await page.getByRole("button", { name: /Claim 추가|Add Claim/i }).click();
await page.getByPlaceholder(/e\.g\. locale|예: locale/i).fill("locale");
await page
.getByLabel(/Claim namespace|Claim 네임스페이스/i)
.first()
.selectOption("top_level");
await page
.getByLabel(/Claim value type|Claim 값 타입/i)
.first()
.selectOption("text");
await page
.getByPlaceholder(/Claim 값을 입력하세요|Enter the claim value/i)
.first()
.fill("ko-KR");
await page.getByRole("button", { name: /Claim 추가|Add Claim/i }).click();
await page
.getByPlaceholder(/e\.g\. locale|예: locale/i)
.nth(1)
.fill("tier");
await page
.getByLabel(/Claim namespace|Claim 네임스페이스/i)
.nth(1)
.selectOption("rp_claims");
await page
.getByLabel(/Claim value type|Claim 값 타입/i)
.nth(1)
.selectOption("number");
await page
.getByPlaceholder(/Claim 값을 입력하세요|Enter the claim value/i)
.nth(1)
.fill("2");
await page.getByRole("button", { name: /^저장$|^Save$/i }).click();
await expect
.poll(() => state.clients[0]?.metadata?.id_token_claims)
.toBeDefined();
await expect
.poll(
() =>
(
state.clients[0]?.metadata?.id_token_claims as
| Array<{
namespace?: string;
key?: string;
value?: string;
valueType?: string;
}>
| undefined
)?.length,
)
.toBe(2);
await expect
.poll(
() =>
(
state.clients[0]?.metadata?.id_token_claims as
| Array<{
namespace?: string;
key?: string;
value?: string;
valueType?: string;
}>
| undefined
)?.[0]?.namespace,
)
.toBe("top_level");
await expect
.poll(
() =>
(
state.clients[0]?.metadata?.id_token_claims as
| Array<{
namespace?: string;
key?: string;
value?: string;
valueType?: string;
}>
| undefined
)?.[0]?.key,
)
.toBe("locale");
await expect
.poll(
() =>
(
state.clients[0]?.metadata?.id_token_claims as
| Array<{
namespace?: string;
key?: string;
value?: string;
valueType?: string;
}>
| undefined
)?.[1]?.namespace,
)
.toBe("rp_claims");
await expect
.poll(
() =>
(
state.clients[0]?.metadata?.id_token_claims as
| Array<{
namespace?: string;
key?: string;
value?: string;
valueType?: string;
}>
| undefined
)?.[1]?.key,
)
.toBe("tier");
await page.reload();
await expect(
page.getByPlaceholder(/e\.g\. locale|예: locale/i),
).toHaveCount(2);
await expect(
page.getByPlaceholder(/e\.g\. locale|예: locale/i).first(),
).toHaveValue("locale");
await expect(
page.getByPlaceholder(/e\.g\. locale|예: locale/i).nth(1),
).toHaveValue("tier");
await expect(
page.getByPlaceholder(/Claim 값을 입력하세요|Enter the claim value/i),
).toHaveCount(2);
await expect(
page
.getByPlaceholder(/Claim 값을 입력하세요|Enter the claim value/i)
.first(),
).toHaveValue("ko-KR");
await expect(
page
.getByPlaceholder(/Claim 값을 입력하세요|Enter the claim value/i)
.nth(1),
).toHaveValue("2");
});
test("pkce headless login uses jwks uri only and shows cache actions", async ({
page,
}) => {

View File

@@ -147,7 +147,9 @@ test.describe("DevFront developer request and management", () => {
await nameInput.fill("E2E Test RP");
await nameInput.press("Tab");
const uriInput = page.locator("textarea.font-mono");
const uriInput = page.getByRole("textbox", {
name: /Redirect URIs|인증 콜백 URL|Callback/i,
});
await uriInput.fill("https://example.com/callback");
await uriInput.press("Tab");