1
0
forked from baron/baron-sso

조직현황 구조변경. 총괄센터삼안 실 조직 삽입확인

This commit is contained in:
2026-05-11 20:13:54 +09:00
parent d3853fac2a
commit 3063450ee0
59 changed files with 5086 additions and 549 deletions

View File

@@ -56,7 +56,7 @@ function user(
status: "active",
tenantSlug,
companyCode: tenantSlug,
position: "사원",
grade: "사원",
createdAt: "2026-04-01T00:00:00.000Z",
updatedAt: "2026-04-01T00:00:00.000Z",
...overrides,
@@ -173,7 +173,8 @@ async function installOrgPickerApiMock(
user("user-platform", "Platform User", "platform", {
metadata: { employeeNumber: "EMP-9001", skill: "Kubernetes" },
jobTitle: "Platform Engineer",
position: "책임",
grade: "책임",
position: "팀장",
}),
user("user-sales", "Sales User", "sales"),
];
@@ -252,14 +253,64 @@ test("picker menu lets developers switch selection mode and selectable type", as
).toBeVisible();
});
test("picker displays user names with job title and position", async ({
test("picker defaults to the hanmac-family company-group when no tenant id is supplied", async ({
page,
}) => {
await page.unroute("**/api/v1/admin/tenants**");
await page.unroute("**/api/v1/admin/users**");
const tenants = [
tenant("wrong-group", "COMPANY_GROUP", "Wrong Group", "wrong-group"),
tenant(
"wrong-company",
"COMPANY",
"Wrong Company",
"wrong-company",
"wrong-group",
),
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
];
await page.route("**/api/v1/admin/tenants**", async (route) => {
await route.fulfill({
contentType: "application/json",
body: JSON.stringify({
items: tenants,
total: tenants.length,
limit: 10000,
offset: 0,
}),
});
});
await page.route("**/api/v1/admin/users**", async (route) => {
await route.fulfill({
contentType: "application/json",
body: JSON.stringify({
items: [],
total: 0,
limit: 5000,
offset: 0,
}),
});
});
await page.goto(withShareToken("/picker"));
const picker = page.frameLocator("iframe");
await expect(picker.getByText("한맥가족", { exact: true })).toBeVisible();
await expect(picker.getByText("삼안", { exact: true })).toBeVisible();
await expect(picker.getByText("Wrong Group", { exact: true })).toHaveCount(0);
});
test("picker displays user names with grade and optional position", async ({
page,
}) => {
await page.goto(withShareToken("/embed/picker?mode=single&select=user"));
await expect(
page.getByRole("button", {
name: "Platform User(Platform Engineer) 책임",
name: "Platform User 책임(팀장)",
}),
).toBeVisible();
});
@@ -319,17 +370,17 @@ test("embed preview menu updates the iframe picker source", async ({
).toBeVisible();
});
test("embed preview passes tenant id and custom dimensions through the picker url", async ({
test("embed preview passes tenant slug and custom dimensions through the picker url", async ({
page,
}) => {
await page.goto(withShareToken("/embed-preview"));
await page.getByLabel("tenant ID").fill("company-baron");
await page.getByLabel("tenant slug").fill("baron");
await page.getByLabel("임베딩 너비").fill("520");
await page.getByLabel("임베딩 높이").fill("480");
await expect(page.getByTestId("embed-preview-src")).toContainText(
"tenantId=company-baron",
"tenantSlug=baron",
);
await expect(page.getByTestId("embed-preview-src")).toContainText(
"width=520",
@@ -347,16 +398,16 @@ test("embed preview passes tenant id and custom dimensions through the picker ur
await expect(picker.getByText("Sales User")).toHaveCount(0);
});
test("embed picker scopes the tree by tenant id, hides users for tenant selection, and keeps direct members before child tenants", async ({
test("embed picker scopes the tree by tenant slug, hides users for tenant selection, and keeps direct members before child tenants", async ({
page,
}) => {
await page.goto(
withShareToken("/embed-preview?tenantId=company-baron&select=tenant"),
withShareToken("/embed-preview?tenantSlug=baron&select=tenant"),
);
await expect(page.getByLabel("tenant ID")).toHaveValue("company-baron");
await expect(page.getByLabel("tenant slug")).toHaveValue("baron");
await expect(page.getByTestId("embed-preview-src")).toContainText(
"tenantId=company-baron",
"tenantSlug=baron",
);
const picker = page.frameLocator("iframe");
@@ -599,7 +650,7 @@ test("embed picker includes descendants by default and can disable descendant in
await picker.getByLabel("Engineering 선택").check();
await expect(picker.getByLabel("Platform 선택")).toBeChecked();
await expect(
picker.getByLabel("Platform User(Platform Engineer) 책임 선택"),
picker.getByLabel("Platform User 책임(팀장) 선택"),
).toBeChecked();
await picker.getByRole("button", { name: "선택 완료" }).click();
@@ -617,7 +668,7 @@ test("embed picker includes descendants by default and can disable descendant in
await picker.getByLabel("Engineering 선택").check();
await expect(picker.getByLabel("Platform 선택")).not.toBeChecked();
await expect(
picker.getByLabel("Platform User(Platform Engineer) 책임 선택"),
picker.getByLabel("Platform User 책임(팀장) 선택"),
).not.toBeChecked();
await picker.getByRole("button", { name: "선택 완료" }).click();