forked from baron/baron-sso
offline_access 제거 확인 추가 및 scope 선택 개선
This commit is contained in:
@@ -99,6 +99,70 @@ test.describe("DevFront RP claim cache", () => {
|
||||
await expect(claimKeyInput).toHaveValue("new_claim");
|
||||
});
|
||||
|
||||
test("adds supported scopes and custom claim keys from the scope picker without offline_access", async ({
|
||||
page,
|
||||
}) => {
|
||||
const state = {
|
||||
clients: [
|
||||
makeClient("client-claims", {
|
||||
name: "Claims app",
|
||||
metadata: {
|
||||
structured_scopes: [
|
||||
{
|
||||
id: "scope-openid",
|
||||
name: "openid",
|
||||
description: "OIDC",
|
||||
mandatory: true,
|
||||
},
|
||||
],
|
||||
id_token_claims: [
|
||||
{
|
||||
namespace: "rp_claims",
|
||||
key: "employee_code",
|
||||
value: "E001",
|
||||
valueType: "text",
|
||||
readPermission: "admin_only",
|
||||
writePermission: "admin_only",
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
],
|
||||
consents: [] as Consent[],
|
||||
relations: {
|
||||
"client-claims": editRelations,
|
||||
},
|
||||
auditLogsByCursor: undefined,
|
||||
mockRole: "super_admin",
|
||||
};
|
||||
await installDevApiMock(page, state);
|
||||
|
||||
await page.goto("http://devfront.test/clients/client-claims/settings");
|
||||
await page
|
||||
.getByRole("button", { name: /스코프 추가|Scope 추가|Add Scope/i })
|
||||
.click();
|
||||
|
||||
await expect(page.getByText("offline_access", { exact: true })).toHaveCount(
|
||||
0,
|
||||
);
|
||||
await expect(
|
||||
page.getByRole("button", { name: /employee_code/ }),
|
||||
).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: /employee_code/ }).click();
|
||||
await page.getByRole("button", { name: /^저장$|^Save$/i }).click();
|
||||
|
||||
await expect
|
||||
.poll(() =>
|
||||
(
|
||||
state.clients[0]?.metadata?.structured_scopes as
|
||||
| Array<{ name?: string }>
|
||||
| undefined
|
||||
)?.some((scope) => scope.name === "employee_code"),
|
||||
)
|
||||
.toBe(true);
|
||||
});
|
||||
|
||||
test("forces read permission on when write permission is enabled", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user