forked from baron/baron-sso
fix(orgfront): place GPDTDC users on leaf appointments
This commit is contained in:
@@ -385,6 +385,71 @@ test("org chart places multi-tenant users only on leaf memberships without dupli
|
||||
await expect(svg.getByText(/^1$/)).toHaveCount(4);
|
||||
});
|
||||
|
||||
test("org chart places GPDTDC representative users on visible leaf appointments", 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("gpdtdc", "GPDTDC", "gpdtdc", "group", "COMPANY"),
|
||||
tenant("tdc", "기술개발센터", "tdc", "gpdtdc", "ORGANIZATION"),
|
||||
tenant("tdc-leaf", "기술개발센터 1팀", "tdc-leaf", "tdc"),
|
||||
tenant(
|
||||
"internal-planning",
|
||||
"내부 구성 조직",
|
||||
"internal-planning",
|
||||
"group",
|
||||
"ORGANIZATION",
|
||||
{ visibility: "internal" },
|
||||
),
|
||||
],
|
||||
users: [
|
||||
{
|
||||
...user("u-gpdtdc-leaf", "GPDTDC Leaf User", "gpdtdc"),
|
||||
tenantSlug: "gpdtdc",
|
||||
companyCode: undefined,
|
||||
metadata: {
|
||||
additionalAppointments: [
|
||||
{
|
||||
tenantSlug: "internal-planning",
|
||||
isPrimary: true,
|
||||
},
|
||||
{
|
||||
tenantSlug: "tdc-leaf",
|
||||
isPrimary: false,
|
||||
grade: "책임",
|
||||
position: "팀장",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto("/chart?token=gpdtdc-leaf");
|
||||
|
||||
await expect(page.getByText("총 1명")).toBeVisible();
|
||||
const svg = page.locator('[data-testid="orgchart-vector-svg"]');
|
||||
await expect(svg).toBeVisible();
|
||||
await expect(svg.getByText("내부 구성 조직")).toHaveCount(0);
|
||||
await expect(
|
||||
page
|
||||
.locator('[data-testid="orgchart-node-gpdtdc"]')
|
||||
.getByText(/GPDTDC Leaf User/),
|
||||
).toHaveCount(0);
|
||||
await expect(
|
||||
page
|
||||
.locator('[data-testid="orgchart-node-tdc-leaf"]')
|
||||
.getByText("GPDTDC Leaf User 책임(팀장)"),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("org chart counts multi-leaf tenant users once in ancestor totals", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user