forked from baron/baron-sso
userfront e2e 전체 테스트
This commit is contained in:
@@ -6,6 +6,7 @@ function tenant(
|
||||
slug: string,
|
||||
parentId?: string,
|
||||
type?: string,
|
||||
config?: Record<string, unknown>,
|
||||
) {
|
||||
return {
|
||||
id,
|
||||
@@ -15,6 +16,7 @@ function tenant(
|
||||
description: "",
|
||||
status: "active",
|
||||
parentId,
|
||||
config,
|
||||
memberCount: 1,
|
||||
createdAt: "2026-04-01T00:00:00.000Z",
|
||||
updatedAt: "2026-04-01T00:00:00.000Z",
|
||||
@@ -151,6 +153,83 @@ test("org chart filters by Hanmac family and company while excluding hanmac.kr a
|
||||
await expect(svg.getByText(/Sales User/)).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("org chart hides internal and private organizations in the status chart", 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("visible", "Visible Org", "visible", "group", "ORGANIZATION"),
|
||||
tenant("internal", "Internal Org", "internal", "group", "ORGANIZATION", {
|
||||
visibility: "internal",
|
||||
}),
|
||||
tenant(
|
||||
"internal-child",
|
||||
"Internal Child",
|
||||
"internal-child",
|
||||
"internal",
|
||||
"ORGANIZATION",
|
||||
),
|
||||
tenant("private", "Private Org", "private", "group", "ORGANIZATION", {
|
||||
visibility: "private",
|
||||
}),
|
||||
],
|
||||
users: [
|
||||
user("u-visible", "Visible User", "visible"),
|
||||
user("u-internal", "Internal User", "internal"),
|
||||
user("u-private", "Private User", "private"),
|
||||
],
|
||||
}),
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto("/chart?token=visibility&includeInternal=true");
|
||||
|
||||
const svg = page.locator('[data-testid="orgchart-vector-svg"]');
|
||||
await expect(svg.getByText("Visible Org")).toBeVisible();
|
||||
await expect(svg.getByText("Visible User 사원")).toBeVisible();
|
||||
await expect(svg.getByText(/Internal Org|Internal Child|Private Org/)).toHaveCount(
|
||||
0,
|
||||
);
|
||||
await expect(svg.getByText(/Internal User|Private User/)).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("org chart balances large member groups with automatic member columns", async ({
|
||||
page,
|
||||
}) => {
|
||||
const members = Array.from({ length: 10 }, (_, index) =>
|
||||
user(`u-member-${index + 1}`, `Member ${index + 1}`, "engineering"),
|
||||
);
|
||||
|
||||
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: members,
|
||||
}),
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto("/chart?token=member-columns");
|
||||
|
||||
const engineeringNode = page.locator(
|
||||
'[data-testid="orgchart-node-engineering"]',
|
||||
);
|
||||
await expect(engineeringNode).toBeVisible();
|
||||
await expect(
|
||||
engineeringNode.locator('[data-member-columns="2"]'),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("org chart displays user names with grade and optional position", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user