forked from baron/baron-sso
chore: consolidate local integration changes
This commit is contained in:
@@ -23,7 +23,27 @@ test.describe("DevFront consents", () => {
|
||||
|
||||
test("consent list and revoke flow", async ({ page }) => {
|
||||
const state = {
|
||||
clients: [makeClient("client-consent", { name: "Consent app" })],
|
||||
clients: [
|
||||
makeClient("client-consent", {
|
||||
name: "Consent app",
|
||||
metadata: {
|
||||
id_token_claims: [
|
||||
{
|
||||
namespace: "rp_claims",
|
||||
key: "contract_date",
|
||||
valueType: "date",
|
||||
value: "2026-06-09",
|
||||
},
|
||||
{
|
||||
namespace: "rp_claims",
|
||||
key: "approved_at",
|
||||
valueType: "datetime",
|
||||
value: "2026-06-09T09:30",
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
],
|
||||
consents: [
|
||||
{
|
||||
subject: "user-1",
|
||||
@@ -36,6 +56,13 @@ test.describe("DevFront consents", () => {
|
||||
status: "active",
|
||||
tenantId: "tenant-a",
|
||||
tenantName: "Tenant A",
|
||||
rpMetadata: {
|
||||
approvalLevel: "A",
|
||||
approvalLevel_permissions: {
|
||||
readPermission: "admin_only",
|
||||
writePermission: "admin_only",
|
||||
},
|
||||
},
|
||||
},
|
||||
] as Consent[],
|
||||
auditLogsByCursor: undefined,
|
||||
@@ -45,6 +72,36 @@ test.describe("DevFront consents", () => {
|
||||
await page.goto("/clients/client-consent/consents");
|
||||
await expect(page.getByText("Alice")).toBeVisible();
|
||||
await expect(page.getByText("Tenant A")).toBeVisible();
|
||||
await expect(page.getByText(/approvalLevel:\s*A/)).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: /Claims|Claim/i }).click();
|
||||
await expect(page.getByText("RP Custom Claims")).toBeVisible();
|
||||
await expect(page.getByText("contract_date")).toBeVisible();
|
||||
await expect(page.getByText("approved_at")).toBeVisible();
|
||||
await expect(page.locator('input[type="date"]')).toHaveValue("2026-06-09");
|
||||
await page.locator('input[type="date"]').fill("2026-06-10");
|
||||
await page.locator('input[type="datetime-local"]').fill("2026-06-09T10:30");
|
||||
await page
|
||||
.getByLabel(/쓰기 권한|Write permission/i)
|
||||
.first()
|
||||
.selectOption("user_and_admin");
|
||||
await page.getByRole("button", { name: /Claim 저장|Save Claim/i }).click();
|
||||
await expect
|
||||
.poll(() => state.consents[0]?.rpMetadata?.contract_date)
|
||||
.toBe("2026-06-10");
|
||||
await expect
|
||||
.poll(() => state.consents[0]?.rpMetadata?.approved_at)
|
||||
.toBe("2026-06-09T10:30");
|
||||
await expect
|
||||
.poll(
|
||||
() =>
|
||||
(
|
||||
state.consents[0]?.rpMetadata?.contract_date_permissions as
|
||||
| Record<string, unknown>
|
||||
| undefined
|
||||
)?.writePermission,
|
||||
)
|
||||
.toBe("user_and_admin");
|
||||
|
||||
await page.getByRole("button", { name: /권한 철회|철회|Revoke/i }).click();
|
||||
await expect(page.getByText(/Revoked|철회/i).first()).toBeVisible();
|
||||
|
||||
Reference in New Issue
Block a user