1
0
forked from baron/baron-sso

chore: consolidate local integration changes

This commit is contained in:
2026-06-09 21:03:05 +09:00
parent aa2848c3b6
commit 1341f07ef9
158 changed files with 10995 additions and 1490 deletions

View File

@@ -269,6 +269,58 @@ test("org chart displays user names with short grade aliases and no job details"
await expect(svg.getByText(/팀장|Platform Engineer/)).toHaveCount(0);
});
test("org chart orders top executive members by rank priority", async ({
page,
}) => {
const executiveUser = (id: string, name: string, grade: string) => ({
...user(id, name, "engineering"),
grade,
});
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: [
executiveUser("u-vice-president", "Vice President", "부사장"),
executiveUser("u-adviser", "Adviser", "고문"),
executiveUser("u-vice-chair", "Vice Chair", "부회장"),
executiveUser("u-president", "President", "사장"),
executiveUser("u-chair", "Chair", "회장"),
executiveUser("u-director", "Director", "전무"),
],
}),
});
});
await page.goto("/chart?token=rank-priority");
const engineeringNode = page.locator(
'[data-testid="orgchart-node-engineering"]',
);
await expect(engineeringNode).toBeVisible();
const orderedMemberIds = await engineeringNode
.locator('[data-testid^="orgchart-member-"]')
.evaluateAll((elements) =>
elements.map((element) => element.getAttribute("data-testid")),
);
expect(orderedMemberIds).toEqual([
"orgchart-member-u-chair",
"orgchart-member-u-president",
"orgchart-member-u-vice-chair",
"orgchart-member-u-adviser",
"orgchart-member-u-vice-president",
"orgchart-member-u-director",
]);
});
test("org chart only highlights flagged member cards", async ({ page }) => {
await page.route("**/api/v1/public/orgchart**", async (route) => {
await route.fulfill({
@@ -422,23 +474,12 @@ test("org chart places multi-tenant users only on leaf memberships without dupli
];
const [groupTenant, baronTenant, engineeringTenant, platformTenant] = tenants;
await page.route("**/api/v1/admin/tenants**", async (route) => {
await page.route("**/api/v1/admin/orgchart/snapshot**", 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: [
tenants,
users: [
multiTenantUser("u-shared", "Shared User", "baron", [
groupTenant,
baronTenant,
@@ -446,9 +487,7 @@ test("org chart places multi-tenant users only on leaf memberships without dupli
platformTenant,
]),
],
total: 1,
limit: 5000,
offset: 0,
cache: { source: "redis", hit: true },
}),
});
});