1
0
forked from baron/baron-sso

조직도 표현 개선

This commit is contained in:
2026-05-29 10:33:15 +09:00
parent 6a6730b544
commit c489c7c38f
34 changed files with 1872 additions and 391 deletions

View File

@@ -230,7 +230,7 @@ test("org chart balances large member groups with automatic member columns", asy
).toBeVisible();
});
test("org chart displays user names with grade and optional position", async ({
test("org chart displays user names with short grade aliases and no job details", async ({
page,
}) => {
await page.route("**/api/v1/public/orgchart**", async (route) => {
@@ -247,7 +247,7 @@ test("org chart displays user names with grade and optional position", async ({
{
...user("u-eng", "Engineering User", "engineering"),
jobTitle: "Platform Engineer",
grade: "책임",
grade: "책임연구원",
position: "팀장",
},
],
@@ -258,7 +258,77 @@ test("org chart displays user names with grade and optional position", async ({
await page.goto("/chart?token=display-name");
const svg = page.locator('[data-testid="orgchart-vector-svg"]');
await expect(svg.getByText("Engineering User 책임(팀장)")).toBeVisible();
await expect(svg.getByText("Engineering User 책임")).toBeVisible();
await expect(svg.getByText(/팀장|Platform Engineer/)).toHaveCount(0);
});
test("org chart only highlights flagged member cards", async ({ page }) => {
await page.route("**/api/v1/public/orgchart**", async (route) => {
await route.fulfill({
contentType: "application/json",
body: JSON.stringify({
sharedWith: "Playwright",
tenants: [
tenant("group", "HMAC Group", "hmac"),
tenant("engineering", "Engineering", "engineering", "group"),
],
users: [
user("u-normal", "Normal User", "engineering"),
{
...user("u-owner", "Owner User", "engineering"),
metadata: {
additionalAppointments: [
{
tenantSlug: "engineering",
isOwner: true,
},
],
},
},
{
...user("u-admin", "Admin User", "engineering"),
metadata: {
additionalAppointments: [
{
tenantSlug: "engineering",
isAdmin: true,
},
],
},
},
{
...user("u-manager", "Manager User", "engineering"),
metadata: {
additionalAppointments: [
{
tenantSlug: "engineering",
isManager: true,
},
],
},
},
],
}),
});
});
await page.goto("/chart?token=highlighted-members");
const engineeringNode = page.locator(
'[data-testid="orgchart-node-engineering"]',
);
await expect(
engineeringNode.locator('[data-testid="orgchart-member-u-normal"]'),
).toHaveAttribute("data-highlighted", "false");
await expect(
engineeringNode.locator('[data-testid="orgchart-member-u-owner"]'),
).toHaveAttribute("data-highlighted", "true");
await expect(
engineeringNode.locator('[data-testid="orgchart-member-u-admin"]'),
).toHaveAttribute("data-highlighted", "true");
await expect(
engineeringNode.locator('[data-testid="orgchart-member-u-manager"]'),
).toHaveAttribute("data-highlighted", "true");
});
test("org chart places multi-tenant users only on leaf memberships without duplicate rendering", async ({
@@ -406,6 +476,14 @@ test("org chart places GPDTDC representative users on visible leaf appointments"
"ORGANIZATION",
{ visibility: "internal" },
),
tenant(
"internal-leaf",
"내부 구성 하위 조직",
"internal-leaf",
"gpdtdc",
"USER_GROUP",
{ visibility: "internal" },
),
],
users: [
{
@@ -427,6 +505,19 @@ test("org chart places GPDTDC representative users on visible leaf appointments"
],
},
},
{
...user("u-hidden-only", "Hidden Only User", "gpdtdc"),
tenantSlug: "gpdtdc",
companyCode: undefined,
metadata: {
additionalAppointments: [
{
tenantSlug: "internal-leaf",
isPrimary: true,
},
],
},
},
],
}),
});
@@ -438,6 +529,8 @@ test("org chart places GPDTDC representative users on visible leaf appointments"
const svg = page.locator('[data-testid="orgchart-vector-svg"]');
await expect(svg).toBeVisible();
await expect(svg.getByText("내부 구성 조직")).toHaveCount(0);
await expect(svg.getByText("내부 구성 하위 조직")).toHaveCount(0);
await expect(svg.getByText(/Hidden Only User/)).toHaveCount(0);
await expect(
page
.locator('[data-testid="orgchart-node-gpdtdc"]')
@@ -446,7 +539,7 @@ test("org chart places GPDTDC representative users on visible leaf appointments"
await expect(
page
.locator('[data-testid="orgchart-node-tdc-leaf"]')
.getByText("GPDTDC Leaf User 책임(팀장)"),
.getByText("GPDTDC Leaf User 책임"),
).toBeVisible();
});