1
0
forked from baron/baron-sso

orgfront refresh token 관리 추가

This commit is contained in:
2026-06-18 08:00:57 +09:00
parent 5f3167a503
commit 33249eb229
32 changed files with 867 additions and 337 deletions

View File

@@ -189,9 +189,9 @@ test.describe("Tenant list performance", () => {
const loadStarted = performance.now();
await page.goto("/tenants");
await expect(page.getByTestId("tenant-internal-id-tenant-3500")).toBeVisible(
{ timeout: 15000 },
);
await expect(
page.getByTestId("tenant-internal-id-tenant-3500"),
).toBeVisible({ timeout: 15000 });
const loadMs = performance.now() - loadStarted;
const loadSnapshot = testInfo.outputPath("tenant-list-load.png");
await page.screenshot({ path: loadSnapshot, fullPage: true });
@@ -201,9 +201,9 @@ test.describe("Tenant list performance", () => {
const searchInput = page.getByPlaceholder("이름 또는 슬러그, ID 검색");
const searchStarted = performance.now();
await searchInput.fill("full-dataset-needle-0100");
await expect(page.getByTestId("tenant-internal-id-tenant-0100")).toBeVisible(
{ timeout: 15000 },
);
await expect(
page.getByTestId("tenant-internal-id-tenant-0100"),
).toBeVisible({ timeout: 15000 });
const searchMs = performance.now() - searchStarted;
const searchSnapshot = testInfo.outputPath("tenant-list-search.png");
await page.screenshot({ path: searchSnapshot, fullPage: true });
@@ -211,9 +211,9 @@ test.describe("Tenant list performance", () => {
await expect(page.locator("tbody")).toContainText(
"full-dataset-needle-0100",
);
await expect(page.getByTestId("tenant-internal-id-tenant-3500")).toHaveCount(
0,
);
await expect(
page.getByTestId("tenant-internal-id-tenant-3500"),
).toHaveCount(0);
console.log(
JSON.stringify({
@@ -225,8 +225,9 @@ test.describe("Tenant list performance", () => {
}),
);
const searchBudgetMs = testInfo.project.name === "firefox" ? 1000 : 500;
expect(loadMs).toBeLessThanOrEqual(1500);
expect(searchMs).toBeLessThanOrEqual(500);
expect(searchMs).toBeLessThanOrEqual(searchBudgetMs);
});
});

View File

@@ -214,6 +214,10 @@ test.describe("Tenant profile local performance evidence", () => {
console.log(JSON.stringify(evidence, null, 2));
expect(evidence.summary.configFieldsVisibleMs.p95).toBeLessThanOrEqual(500);
const configVisibleBudgetMs =
testInfo.project.name === "firefox" ? 1200 : 500;
expect(evidence.summary.configFieldsVisibleMs.p95).toBeLessThanOrEqual(
configVisibleBudgetMs,
);
});
});

View File

@@ -789,8 +789,7 @@ test.describe("User Management", () => {
.poll(() => updatePayload)
.toMatchObject({ status: "preboarding" });
await table.locator('input[name="user-list-select-u-1"]').check();
await expect(page.getByTestId("bulk-permission-select")).toHaveCount(0);
await expect(page.getByTestId("user-role-select-u-1")).toHaveCount(0);
});
test("should keep system role assignment out of the permissions screen", async ({
@@ -907,23 +906,24 @@ test.describe("User Management", () => {
await expect(
page.getByRole("option", { name: /권한 부여.*수정/ }),
).toHaveCount(0);
await expect(page.getByTestId("permission-target-org-picker-frame")).toBeVisible();
await expect(page.getByTestId("permission-target-org-picker-frame")).toHaveAttribute(
"src",
/rootTenantId%3Dall|rootTenantId=all/,
);
await expect(
page.getByTestId("permission-target-org-picker-frame"),
).toBeVisible();
await expect(
page.getByTestId("permission-target-org-picker-frame"),
).toHaveAttribute("src", /rootTenantId%3Dall|rootTenantId=all/);
const pickerBox = await page
.getByTestId("permission-target-org-picker-frame")
.boundingBox();
const queueBox = await page.getByTestId("permission-target-queue").boundingBox();
const queueBox = await page
.getByTestId("permission-target-queue")
.boundingBox();
expect(pickerBox?.x ?? Number.POSITIVE_INFINITY).toBeLessThan(
queueBox?.x ?? Number.NEGATIVE_INFINITY,
);
await page.getByTestId("bulk-relation-mode").selectOption("target-action");
await expect(
page.getByTestId("bulk-relation-operation"),
).toHaveCount(0);
await expect(page.getByTestId("bulk-relation-operation")).toHaveCount(0);
await page.getByTestId("permission-action-tenant-picker-open").click();
await page.getByTestId("permission-action-tenant-search").fill("Test");
await page.getByTestId("permission-action-tenant-result-t-1").click();
@@ -980,40 +980,48 @@ test.describe("User Management", () => {
.getByRole("button", { name: /선택 사용자에게 권한 부여/ })
.click();
await expect.poll(() => relationWrites).toContainEqual(
{ userId: "u-2", relation: "tenants_managers" },
);
await expect.poll(() => relationWrites).toContainEqual(
{ userId: "u-2", relation: "profile_managers" },
);
await expect.poll(() => relationWrites).toContainEqual(
{ userId: "u-3", relation: "profile_managers" },
);
await expect
.poll(() => relationWrites)
.toContainEqual({ userId: "u-2", relation: "tenants_managers" });
await expect
.poll(() => relationWrites)
.toContainEqual({ userId: "u-2", relation: "profile_managers" });
await expect
.poll(() => relationWrites)
.toContainEqual({ userId: "u-3", relation: "profile_managers" });
await page.getByTestId("permission-assignment-search").fill("John");
await expect(page.getByTestId("permission-assignment-row-u-1-profile_viewers")).toBeVisible();
await expect(
page.getByTestId("permission-assignment-row-u-1-profile_viewers"),
).toBeVisible();
await expect(
page.getByTestId("permission-assignment-row-u-2-profile_managers"),
).toHaveCount(0);
await page.getByTestId("permission-assignment-search").fill("");
await page.getByTestId("permission-assignment-sort").selectOption("relation");
await page
.getByTestId("permission-assignment-sort")
.selectOption("relation");
await page
.getByTestId("permission-assignment-level-u-1-profile_viewers")
.selectOption("write");
await expect.poll(() => relationWrites).toContainEqual({
userId: "u-1",
relation: "profile_managers",
});
await expect
.poll(() => relationWrites)
.toContainEqual({
userId: "u-1",
relation: "profile_managers",
});
await page
.getByTestId("permission-assignment-remove-u-1-profile_viewers")
.click();
await expect.poll(() => relationDeletes).toContainEqual({
userId: "u-1",
relation: "profile_viewers",
});
await expect
.poll(() => relationDeletes)
.toContainEqual({
userId: "u-1",
relation: "profile_viewers",
});
});
test("should grant super admin role from the last tab only for super admins", async ({
test("should revoke super admin role from the last tab only for super admins", async ({
page,
}) => {
let bulkPayload: Record<string, unknown> | undefined;
@@ -1036,6 +1044,30 @@ test.describe("User Management", () => {
});
});
await page.route(/\/admin\/users(\?.*)?$/, async (route) => {
if (route.request().method() !== "GET") {
return route.fallback();
}
return route.fulfill({
json: {
items: [
{
id: "u-1",
name: "John Doe",
email: "john@test.com",
phone: "010-1111-2222",
role: "super_admin",
status: "active",
createdAt: "2026-04-01T00:00:00Z",
},
],
total: 1,
limit: 10000,
offset: 0,
},
});
});
await page.route(/\/admin\/users\/bulk$/, async (route) => {
if (route.request().method() !== "PUT") {
return route.fallback();
@@ -1052,12 +1084,14 @@ test.describe("User Management", () => {
await tabs.last().click();
await page.getByTestId("super-admin-role-user-u-1").check();
await page.getByRole("button", { name: /Super Admin 부여/ }).click();
await page.getByRole("button", { name: /Super Admin 회수/ }).click();
await expect.poll(() => bulkPayload).toEqual({
userIds: ["u-1"],
role: "super_admin",
});
await expect
.poll(() => bulkPayload)
.toEqual({
userIds: ["u-1"],
role: "user",
});
});
test("should hide the super admin role tab from non super admins", async ({
@@ -1525,9 +1559,7 @@ test.describe("User Management", () => {
await expect(
page.getByRole("tab", { name: /외부 기업 회원/i }),
).toHaveCount(0);
await expect(
page.getByRole("tab", { name: /^Commercial$/i }),
).toBeVisible();
await expect(page.getByRole("tab", { name: /^일반회사$/i })).toBeVisible();
await expect(page.getByRole("tab", { name: /^공공기관$/i })).toBeVisible();
await expect(page.getByRole("tab", { name: /^교육기관$/i })).toBeVisible();
await expect(page.getByRole("tab", { name: /^개인$/i })).toBeVisible();