1
0
forked from baron/baron-sso

orgfront 권한 정리

This commit is contained in:
2026-06-10 08:37:27 +09:00
parent cad1162597
commit 28478309fa
20 changed files with 2271 additions and 7 deletions

View File

@@ -501,6 +501,67 @@ test("org chart places multi-tenant users only on leaf memberships without dupli
await expect(svg.getByText(/^1$/)).toHaveCount(4);
});
test("org chart allows a user in a hanmac-family descendant tenant", async ({
page,
}) => {
await page.addInitScript(() => {
window.localStorage.setItem("playwright_auth_bypass", "1");
window.localStorage.setItem("dev_tenant_id", "saman-id");
});
await page.route("**/api/v1/admin/orgchart/snapshot**", async (route) => {
expect(route.request().headers()["x-tenant-id"]).toBe("saman-id");
await route.fulfill({
contentType: "application/json",
body: JSON.stringify({
tenants: [
{
...tenant("hanmac-family-id", "한맥가족", "hanmac-family"),
type: "COMPANY_GROUP",
},
tenant("saman-id", "삼안", "saman", "hanmac-family-id", "COMPANY"),
tenant("saman-platform-id", "플랫폼팀", "saman-platform", "saman-id"),
],
users: [
{
...user("u-saman", "Saman Descendant User", "saman-platform"),
tenantSlug: "saman",
tenant: tenant(
"saman-id",
"삼안",
"saman",
"hanmac-family-id",
"COMPANY",
),
joinedTenants: [
tenant(
"saman-platform-id",
"플랫폼팀",
"saman-platform",
"saman-id",
),
],
},
],
cache: { source: "redis", hit: true },
}),
});
});
await page.goto("/chart");
await expect(
page.getByText("조직도를 불러올 수 없거나 만료된 링크입니다."),
).toHaveCount(0);
await expect(
page.getByRole("button", { name: "조직: 한맥가족" }),
).toBeVisible();
const svg = page.locator('[data-testid="orgchart-vector-svg"]');
await expect(svg.getByText("한맥가족", { exact: true })).toBeVisible();
await expect(svg.getByText("삼안", { exact: true })).toBeVisible();
await expect(svg.getByText(/Saman Descendant User/)).toBeVisible();
});
test("org chart places GPDTDC representative users on visible leaf appointments", async ({
page,
}) => {