forked from baron/baron-sso
custom claim 권한체크 확인
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { installAdminFrontStaticRoutes } from "./helpers/static-adminfront";
|
||||
|
||||
test.describe("User Management", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await installAdminFrontStaticRoutes(page);
|
||||
|
||||
await page.addInitScript(() => {
|
||||
const authority = "http://localhost:5000/oidc";
|
||||
const client_id = "adminfront";
|
||||
@@ -397,20 +400,25 @@ test.describe("User Management", () => {
|
||||
.click();
|
||||
|
||||
await expect(page.getByText("contract_date")).toBeVisible();
|
||||
const valueInput = page.getByTestId(
|
||||
|
||||
const claimValueInput = page.getByTestId(
|
||||
"global-custom-claim-value-contract_date",
|
||||
);
|
||||
await expect(valueInput).toHaveValue("2026-06-09");
|
||||
await expect(valueInput).toHaveAttribute("type", "date");
|
||||
await expect(claimValueInput).toHaveValue("2026-06-09");
|
||||
await expect(claimValueInput).toHaveAttribute("type", "date");
|
||||
await expect(page.getByText(/사용자.*관리자/)).toBeVisible();
|
||||
await expect(page.getByText("관리자만 가능")).toBeVisible();
|
||||
|
||||
await valueInput.fill("2026-07-01");
|
||||
await claimValueInput.fill("2026-07-01");
|
||||
|
||||
await page.screenshot({
|
||||
path: "test-results/adminfront-global-custom-claim-permissions.png",
|
||||
path: "test-results/adminfront-global-custom-claim-values.png",
|
||||
fullPage: true,
|
||||
});
|
||||
|
||||
await page.getByRole("button", { name: /사용자 Claim 값 저장/i }).click();
|
||||
await page
|
||||
.getByRole("button", { name: /사용자 Claim 값 저장|Save User Claim/i })
|
||||
.click();
|
||||
|
||||
await expect
|
||||
.poll(() => updatePayload)
|
||||
@@ -424,7 +432,7 @@ test.describe("User Management", () => {
|
||||
},
|
||||
global_custom_claim_permissions: {
|
||||
contract_date: {
|
||||
readPermission: "admin_only",
|
||||
readPermission: "user_and_admin",
|
||||
writePermission: "admin_only",
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user