forked from baron/baron-sso
feat: improve Worksmobile tenant sync handling
This commit is contained in:
@@ -1068,7 +1068,7 @@ test.describe("Tenants Management", () => {
|
||||
await expect(page.getByTestId("tenant-detail-copy-uuid")).toBeVisible();
|
||||
});
|
||||
|
||||
test("should place hanmac org config beside parent tenant picker", async ({
|
||||
test("should place tenant profile core settings in dense rows", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.setViewportSize({ width: 1280, height: 800 });
|
||||
@@ -1119,29 +1119,102 @@ test.describe("Tenants Management", () => {
|
||||
|
||||
await page.goto("/tenants/team-1");
|
||||
|
||||
const layout = page.getByTestId("tenant-parent-org-config-layout");
|
||||
await expect(layout).toBeVisible({ timeout: 20000 });
|
||||
await expect(layout).toContainText("상위 테넌트");
|
||||
await expect(layout).toContainText("조직 세부타입");
|
||||
await expect(layout).toContainText("공개 범위");
|
||||
const topLayout = page.getByTestId("tenant-profile-primary-row");
|
||||
const configLayout = page.getByTestId("tenant-profile-config-row");
|
||||
await expect(topLayout).toBeVisible({ timeout: 20000 });
|
||||
await expect(configLayout).toBeVisible();
|
||||
await expect(topLayout).toContainText("테넌트 이름");
|
||||
await expect(topLayout).toContainText("슬러그");
|
||||
await expect(topLayout).toContainText("상위 테넌트");
|
||||
await expect(configLayout).toContainText("테넌트 유형");
|
||||
await expect(configLayout).toContainText("조직 세부타입");
|
||||
await expect(configLayout).toContainText("공개 범위");
|
||||
await expect(configLayout).toContainText("WORKS 연동");
|
||||
const orgUnitTypeSelect = page.getByTestId("tenant-org-unit-type-select");
|
||||
await expect(orgUnitTypeSelect).toBeVisible();
|
||||
await expect(orgUnitTypeSelect.locator("option")).toHaveText([
|
||||
"없음",
|
||||
"팀",
|
||||
"TF",
|
||||
"TF팀",
|
||||
"셀",
|
||||
]);
|
||||
|
||||
const columns = await layout.evaluate(
|
||||
const topColumns = await topLayout.evaluate(
|
||||
(element) => window.getComputedStyle(element).gridTemplateColumns,
|
||||
);
|
||||
expect(columns.split(" ").length).toBe(4);
|
||||
const configColumns = await configLayout.evaluate(
|
||||
(element) => window.getComputedStyle(element).gridTemplateColumns,
|
||||
);
|
||||
expect(topColumns.split(" ").length).toBe(3);
|
||||
expect(configColumns.split(" ").length).toBe(4);
|
||||
|
||||
const parentWidth = await page
|
||||
const nameTop = await page
|
||||
.getByTestId("tenant-name-slot")
|
||||
.evaluate((element) => element.getBoundingClientRect().top);
|
||||
const slugTop = await page
|
||||
.getByTestId("tenant-slug-slot")
|
||||
.evaluate((element) => element.getBoundingClientRect().top);
|
||||
const parentTop = await page
|
||||
.getByTestId("tenant-parent-picker-slot")
|
||||
.evaluate((element) => element.getBoundingClientRect().width);
|
||||
const orgUnitWidth = await page
|
||||
.evaluate((element) => element.getBoundingClientRect().top);
|
||||
const nameInputHeight = await page
|
||||
.getByTestId("tenant-name-slot")
|
||||
.locator("input")
|
||||
.evaluate((element) => element.getBoundingClientRect().height);
|
||||
const slugInputHeight = await page
|
||||
.getByTestId("tenant-slug-slot")
|
||||
.locator("input")
|
||||
.evaluate((element) => element.getBoundingClientRect().height);
|
||||
const parentControlHeight = await page
|
||||
.getByTestId("tenant-parent-picker-control")
|
||||
.evaluate((element) => element.getBoundingClientRect().height);
|
||||
const typeTop = await page
|
||||
.getByTestId("tenant-type-slot")
|
||||
.evaluate((element) => element.getBoundingClientRect().top);
|
||||
const orgUnitTop = await page
|
||||
.getByTestId("tenant-org-unit-type-slot")
|
||||
.evaluate((element) => element.getBoundingClientRect().width);
|
||||
const visibilityWidth = await page
|
||||
.evaluate((element) => element.getBoundingClientRect().top);
|
||||
const visibilityTop = await page
|
||||
.getByTestId("tenant-visibility-slot")
|
||||
.evaluate((element) => element.getBoundingClientRect().width);
|
||||
.evaluate((element) => element.getBoundingClientRect().top);
|
||||
const worksExcludedTop = await page
|
||||
.getByTestId("tenant-worksmobile-excluded-slot")
|
||||
.evaluate((element) => element.getBoundingClientRect().top);
|
||||
|
||||
expect(parentWidth).toBeGreaterThan(orgUnitWidth * 1.7);
|
||||
expect(parentWidth).toBeLessThan(orgUnitWidth * 2.3);
|
||||
expect(Math.abs(orgUnitWidth - visibilityWidth)).toBeLessThan(8);
|
||||
expect(Math.abs(nameTop - slugTop)).toBeLessThan(4);
|
||||
expect(Math.abs(nameTop - parentTop)).toBeLessThan(4);
|
||||
expect(Math.abs(nameInputHeight - slugInputHeight)).toBeLessThan(2);
|
||||
expect(Math.abs(nameInputHeight - parentControlHeight)).toBeLessThan(4);
|
||||
expect(Math.abs(typeTop - orgUnitTop)).toBeLessThan(4);
|
||||
expect(Math.abs(typeTop - visibilityTop)).toBeLessThan(4);
|
||||
expect(Math.abs(typeTop - worksExcludedTop)).toBeLessThan(4);
|
||||
|
||||
await page.getByTestId("tenant-type-select").selectOption("COMPANY");
|
||||
await expect(orgUnitTypeSelect.locator("option")).toHaveText([
|
||||
"없음",
|
||||
"실",
|
||||
"팀",
|
||||
"TF",
|
||||
"TF팀",
|
||||
"센터",
|
||||
"디비전",
|
||||
"셀",
|
||||
"본부",
|
||||
"지역본부",
|
||||
"부",
|
||||
"임원직속",
|
||||
]);
|
||||
|
||||
const overflow = await page.evaluate(() => ({
|
||||
horizontal:
|
||||
document.documentElement.scrollWidth >
|
||||
document.documentElement.clientWidth,
|
||||
vertical:
|
||||
document.documentElement.scrollHeight >
|
||||
document.documentElement.clientHeight,
|
||||
}));
|
||||
expect(overflow.horizontal).toBe(false);
|
||||
expect(overflow.vertical).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -729,7 +729,6 @@ test.describe("User Management", () => {
|
||||
await expect(page.getByTestId("appointment-position-line-0")).toBeVisible();
|
||||
await page.getByRole("switch", { name: /대표 조직/i }).click();
|
||||
await page.getByLabel(/^직무$/i).fill("플랫폼 운영");
|
||||
await page.getByLabel(/^직급$/i).fill("책임");
|
||||
await page.getByLabel(/^직책$/i).fill("팀장");
|
||||
|
||||
await page.locator('input[name="name"]').fill("Family User");
|
||||
@@ -829,6 +828,7 @@ test.describe("User Management", () => {
|
||||
test("should show Hanmac family appointments layout on user detail", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.setViewportSize({ width: 520, height: 900 });
|
||||
await page.route(/\/admin\/users\/u-1$/, async (route) => {
|
||||
if (route.request().method() === "GET") {
|
||||
return route.fulfill({
|
||||
@@ -847,7 +847,7 @@ test.describe("User Management", () => {
|
||||
{
|
||||
tenantId: "03dbe16b-e47b-4f72-927b-782807d67a35",
|
||||
tenantSlug: "tech-planning",
|
||||
tenantName: "기술기획",
|
||||
tenantName: "기술기획 장기 운영 전략 조직",
|
||||
isPrimary: true,
|
||||
isOwner: true,
|
||||
grade: "책임",
|
||||
@@ -872,6 +872,32 @@ test.describe("User Management", () => {
|
||||
await expect(
|
||||
page.getByTestId("detail-appointment-tenant-owner-line-0"),
|
||||
).toContainText(/기술기획|대표 조직|조직장/);
|
||||
await expect(
|
||||
page.getByTestId("detail-appointment-tenant-owner-controls-0"),
|
||||
).toHaveCSS("flex-wrap", "nowrap");
|
||||
|
||||
const tenantPickerBox = await page
|
||||
.getByTestId("detail-appointment-tenant-picker-0")
|
||||
.boundingBox();
|
||||
const ownerSwitchBox = await page
|
||||
.getByTestId("detail-appointment-row-0")
|
||||
.getByRole("switch", { name: /대표 조직/i })
|
||||
.boundingBox();
|
||||
const managerSwitchBox = await page
|
||||
.getByTestId("detail-appointment-row-0")
|
||||
.getByRole("switch", { name: /조직장/i })
|
||||
.boundingBox();
|
||||
|
||||
if (!tenantPickerBox || !ownerSwitchBox || !managerSwitchBox) {
|
||||
throw new Error("Appointment tenant owner controls are not visible.");
|
||||
}
|
||||
|
||||
const centerYs = [
|
||||
tenantPickerBox.y + tenantPickerBox.height / 2,
|
||||
ownerSwitchBox.y + ownerSwitchBox.height / 2,
|
||||
managerSwitchBox.y + managerSwitchBox.height / 2,
|
||||
];
|
||||
expect(Math.max(...centerYs) - Math.min(...centerYs)).toBeLessThan(8);
|
||||
await expect(
|
||||
page.getByTestId("detail-appointment-row-0").getByRole("switch", {
|
||||
name: /대표 조직/i,
|
||||
|
||||
@@ -38,6 +38,11 @@ test.describe("Worksmobile tenant management", () => {
|
||||
const url = new URL(route.request().url());
|
||||
const method = route.request().method();
|
||||
const headers = { "Access-Control-Allow-Origin": "*" };
|
||||
const isWorksmobileTenantPath = (suffix: string) =>
|
||||
url.pathname.endsWith(`/admin/tenants/hanmac-family-id${suffix}`) ||
|
||||
url.pathname.endsWith(
|
||||
`/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a${suffix}`,
|
||||
);
|
||||
|
||||
if (url.pathname.endsWith("/user/me")) {
|
||||
return route.fulfill({
|
||||
@@ -45,7 +50,14 @@ test.describe("Worksmobile tenant management", () => {
|
||||
id: "admin-user",
|
||||
name: "Admin",
|
||||
role: "super_admin",
|
||||
manageableTenants: [],
|
||||
manageableTenants: [
|
||||
{
|
||||
id: "038326b6-954a-48a7-a85f-efd83f62b82a",
|
||||
name: "한맥 가족",
|
||||
slug: "hanmac-family",
|
||||
type: "COMPANY_GROUP",
|
||||
},
|
||||
],
|
||||
},
|
||||
headers,
|
||||
});
|
||||
@@ -68,10 +80,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith("/admin/tenants/hanmac-family-id/worksmobile") &&
|
||||
method === "GET"
|
||||
) {
|
||||
if (isWorksmobileTenantPath("/worksmobile") && method === "GET") {
|
||||
return route.fulfill({
|
||||
json: {
|
||||
tenant: {
|
||||
@@ -95,18 +104,14 @@ test.describe("Worksmobile tenant management", () => {
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/credential-batches",
|
||||
) &&
|
||||
isWorksmobileTenantPath("/worksmobile/credential-batches") &&
|
||||
method === "GET"
|
||||
) {
|
||||
return route.fulfill({ json: [], headers });
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/comparison",
|
||||
) &&
|
||||
isWorksmobileTenantPath("/worksmobile/comparison") &&
|
||||
method === "GET"
|
||||
) {
|
||||
const includeMatched =
|
||||
@@ -210,9 +215,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/users/user-missing/sync",
|
||||
) &&
|
||||
isWorksmobileTenantPath("/worksmobile/users/user-missing/sync") &&
|
||||
method === "POST"
|
||||
) {
|
||||
syncRequests.push("user-missing");
|
||||
@@ -225,24 +228,51 @@ test.describe("Worksmobile tenant management", () => {
|
||||
return route.fulfill({ json: { items: [], total: 0 }, headers });
|
||||
});
|
||||
|
||||
await page.goto("/tenants/hanmac-family-id");
|
||||
await page.getByRole("link", { name: "Worksmobile" }).click();
|
||||
await page.goto("/");
|
||||
await expect(
|
||||
page.getByRole("link", { name: "Worksmobile" }),
|
||||
).toHaveAttribute("href", "/worksmobile");
|
||||
await page.goto("/worksmobile");
|
||||
|
||||
await expect(page).toHaveURL(/\/tenants\/hanmac-family-id\/worksmobile$/);
|
||||
await expect(page.getByText("Baron / Works 비교")).toBeVisible();
|
||||
await expect(page).toHaveURL(/\/worksmobile$/);
|
||||
await expect(page.getByRole("tab", { name: "이력" })).toBeVisible();
|
||||
await expect(page.getByRole("tab", { name: "사용자" })).toBeVisible();
|
||||
await expect(page.getByRole("tab", { name: "조직" })).toBeVisible();
|
||||
await expect(page.getByText("비밀번호 파일 히스토리")).toBeVisible();
|
||||
await expect(page.getByText("domainMappings")).not.toBeVisible();
|
||||
await expect(page.getByText("SCIM token")).not.toBeVisible();
|
||||
await page.getByRole("tab", { name: "사용자" }).click();
|
||||
await expect(page.getByText("사용자 단건 동기화")).toBeVisible();
|
||||
await expect(page.getByPlaceholder("Kratos user UUID")).toBeVisible();
|
||||
const userSyncCard = page.getByTestId("worksmobile-users-single-sync");
|
||||
const userComparisonTable = page.getByTestId(
|
||||
"worksmobile-구성원-virtual-body",
|
||||
);
|
||||
await expect(userComparisonTable).toBeVisible();
|
||||
await expect(userSyncCard).toBeVisible();
|
||||
expect(
|
||||
await page.evaluate(() => {
|
||||
const table = document.querySelector(
|
||||
'[data-testid="worksmobile-구성원-virtual-body"]',
|
||||
);
|
||||
const sync = document.querySelector(
|
||||
'[data-testid="worksmobile-users-single-sync"]',
|
||||
);
|
||||
return Boolean(
|
||||
table &&
|
||||
sync &&
|
||||
table.compareDocumentPosition(sync) &
|
||||
Node.DOCUMENT_POSITION_FOLLOWING,
|
||||
);
|
||||
}),
|
||||
).toBe(true);
|
||||
await expect(page.getByText("김누락")).toBeVisible();
|
||||
await expect(page.getByText("박웍스")).toBeVisible();
|
||||
await expect(page.getByText("숨김 SU")).not.toBeVisible();
|
||||
await expect(page.getByText("숨김 CYHAN1")).not.toBeVisible();
|
||||
await expect(page.getByText("su-@samaneng.com")).not.toBeVisible();
|
||||
await expect(page.getByText("cyhan1@hanmaceng.co.kr")).not.toBeVisible();
|
||||
await expect(page.getByText("WORKS 전용 조직")).toBeVisible();
|
||||
await expect(page.getByText("기술본부", { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("parent-tech", { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("WORKS 기술본부")).toBeVisible();
|
||||
await expect(page.getByText("works-parent-tech")).toBeVisible();
|
||||
await expect(page.getByText("WORKS 전용 조직")).not.toBeVisible();
|
||||
await expect(page.getByText("홍길동")).not.toBeVisible();
|
||||
expect(comparisonRequests[0]).toBe(true);
|
||||
|
||||
@@ -321,6 +351,37 @@ test.describe("Worksmobile tenant management", () => {
|
||||
.getByRole("button", { name: "선택 구성원 WORKS에 생성" })
|
||||
.click();
|
||||
await expect.poll(() => syncRequests).toEqual(["user-missing"]);
|
||||
|
||||
await page.getByRole("tab", { name: "조직" }).click();
|
||||
await expect(page.getByText("조직 단건 동기화")).toBeVisible();
|
||||
await expect(page.getByPlaceholder("orgUnit tenant UUID")).toBeVisible();
|
||||
const groupSyncCard = page.getByTestId("worksmobile-groups-single-sync");
|
||||
const groupComparisonTable = page.getByTestId(
|
||||
"worksmobile-조직/그룹-virtual-body",
|
||||
);
|
||||
await expect(groupComparisonTable).toBeVisible();
|
||||
await expect(groupSyncCard).toBeVisible();
|
||||
expect(
|
||||
await page.evaluate(() => {
|
||||
const table = document.querySelector(
|
||||
'[data-testid="worksmobile-조직/그룹-virtual-body"]',
|
||||
);
|
||||
const sync = document.querySelector(
|
||||
'[data-testid="worksmobile-groups-single-sync"]',
|
||||
);
|
||||
return Boolean(
|
||||
table &&
|
||||
sync &&
|
||||
table.compareDocumentPosition(sync) &
|
||||
Node.DOCUMENT_POSITION_FOLLOWING,
|
||||
);
|
||||
}),
|
||||
).toBe(true);
|
||||
await expect(page.getByText("WORKS 전용 조직")).toBeVisible();
|
||||
await expect(page.getByText("기술본부", { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("parent-tech", { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("WORKS 기술본부")).toBeVisible();
|
||||
await expect(page.getByText("works-parent-tech")).toBeVisible();
|
||||
});
|
||||
|
||||
test("shows a toast when selected WORKS creation fails", async ({ page }) => {
|
||||
@@ -352,7 +413,9 @@ test.describe("Worksmobile tenant management", () => {
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith("/admin/tenants/hanmac-family-id/worksmobile") &&
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
return route.fulfill({
|
||||
@@ -372,7 +435,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/credential-batches",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/credential-batches",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
@@ -381,7 +444,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/comparison",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/comparison",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
@@ -403,7 +466,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/users/user-fail/sync",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/users/user-fail/sync",
|
||||
) &&
|
||||
method === "POST"
|
||||
) {
|
||||
@@ -417,7 +480,8 @@ test.describe("Worksmobile tenant management", () => {
|
||||
return route.fulfill({ json: { items: [], total: 0 }, headers });
|
||||
});
|
||||
|
||||
await page.goto("/tenants/hanmac-family-id/worksmobile");
|
||||
await page.goto("/worksmobile");
|
||||
await page.getByRole("tab", { name: "사용자" }).click();
|
||||
await page
|
||||
.getByRole("row", { name: /실패 사용자/ })
|
||||
.getByRole("checkbox")
|
||||
@@ -465,7 +529,9 @@ test.describe("Worksmobile tenant management", () => {
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith("/admin/tenants/hanmac-family-id/worksmobile") &&
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
return route.fulfill({
|
||||
@@ -487,7 +553,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/credential-batches",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/credential-batches",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
@@ -496,7 +562,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/comparison",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/comparison",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
@@ -537,7 +603,8 @@ test.describe("Worksmobile tenant management", () => {
|
||||
return route.fulfill({ json: { items: [], total: 0 }, headers });
|
||||
});
|
||||
|
||||
await page.goto("/tenants/hanmac-family-id/worksmobile");
|
||||
await page.goto("/worksmobile");
|
||||
await page.getByRole("tab", { name: "사용자" }).click();
|
||||
await expect(page.getByText("긴 WORKS 사용자")).toBeVisible();
|
||||
|
||||
const userColumnButton = page
|
||||
@@ -608,7 +675,9 @@ test.describe("Worksmobile tenant management", () => {
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith("/admin/tenants/hanmac-family-id/worksmobile") &&
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
return route.fulfill({
|
||||
@@ -664,6 +733,24 @@ test.describe("Worksmobile tenant management", () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "job-pending",
|
||||
resourceType: "ORGUNIT",
|
||||
resourceId: "org-pending",
|
||||
action: "UPSERT",
|
||||
status: "pending",
|
||||
retryCount: 0,
|
||||
createdAt: "2026-05-01T00:00:00Z",
|
||||
updatedAt: "2026-05-01T00:01:00Z",
|
||||
payload: {
|
||||
matchLocalPart: "halla-site",
|
||||
requestSummary: {
|
||||
orgUnitName: "한라 현장",
|
||||
email: "halla-site@hallasanup.com",
|
||||
orgUnitExternalKey: "org-pending",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
headers,
|
||||
@@ -672,7 +759,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/credential-batches",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/credential-batches",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
@@ -696,7 +783,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/comparison",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/comparison",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
@@ -708,7 +795,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/initial-passwords.csv",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/initial-passwords.csv",
|
||||
) &&
|
||||
method === "GET"
|
||||
) {
|
||||
@@ -726,7 +813,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/backfill/dry-run",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/backfill/dry-run",
|
||||
) &&
|
||||
method === "POST"
|
||||
) {
|
||||
@@ -736,7 +823,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/orgunits/org-1/sync",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/orgunits/org-1/sync",
|
||||
) &&
|
||||
method === "POST"
|
||||
) {
|
||||
@@ -746,7 +833,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/users/user-1/sync",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/users/user-1/sync",
|
||||
) &&
|
||||
method === "POST"
|
||||
) {
|
||||
@@ -756,7 +843,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/hanmac-family-id/worksmobile/jobs/job-retry/retry",
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/jobs/job-retry/retry",
|
||||
) &&
|
||||
method === "POST"
|
||||
) {
|
||||
@@ -764,10 +851,20 @@ test.describe("Worksmobile tenant management", () => {
|
||||
return route.fulfill({ json: { id: "job-retry-next" }, headers });
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/jobs/pending",
|
||||
) &&
|
||||
method === "DELETE"
|
||||
) {
|
||||
requests.push("delete-pending");
|
||||
return route.fulfill({ json: { deletedCount: 1 }, headers });
|
||||
}
|
||||
|
||||
return route.fulfill({ json: { items: [], total: 0 }, headers });
|
||||
});
|
||||
|
||||
await page.goto("/tenants/hanmac-family-id/worksmobile");
|
||||
await page.goto("/worksmobile");
|
||||
await expect(page.getByText("Worksmobile 연동")).toBeVisible();
|
||||
|
||||
const download = page.waitForEvent("download");
|
||||
@@ -785,27 +882,41 @@ test.describe("Worksmobile tenant management", () => {
|
||||
await page.getByRole("button", { name: "Backfill Dry-run" }).click();
|
||||
await expect.poll(() => requests).toContain("dry-run");
|
||||
|
||||
await page.getByRole("tab", { name: "조직" }).click();
|
||||
await page.getByPlaceholder("orgUnit tenant UUID").fill("org-1");
|
||||
await page.getByRole("button", { name: "조직 Sync" }).click();
|
||||
await expect.poll(() => requests).toContain("org-sync");
|
||||
|
||||
await page.getByRole("tab", { name: "사용자" }).click();
|
||||
await page.getByPlaceholder("Kratos user UUID").fill("user-1");
|
||||
await page.getByRole("button", { name: "구성원 Sync" }).click();
|
||||
await expect.poll(() => requests).toContain("user-sync");
|
||||
|
||||
await page.getByRole("tab", { name: "이력" }).click();
|
||||
await expect(page.getByRole("row", { name: /변경 사용자/ })).toContainText(
|
||||
"changed-user@example.com",
|
||||
);
|
||||
await expect(
|
||||
page.getByRole("row", { name: /ORGUNIT:people-growth/ }),
|
||||
).toContainText("people-growth@example.com");
|
||||
await expect(page.getByText("externalKey:parent-org")).toBeVisible();
|
||||
await expect(
|
||||
page
|
||||
.getByRole("row", { name: /ORGUNIT:people-growth/ })
|
||||
.getByText("externalKey:parent-org")
|
||||
.first(),
|
||||
).toBeVisible();
|
||||
const failedJobRow = page.getByRole("row", { name: /변경 사용자/ });
|
||||
await failedJobRow.getByText("payload").click();
|
||||
await expect(
|
||||
failedJobRow.getByText('"loginEmail": "changed-user@example.com"'),
|
||||
).toBeVisible();
|
||||
|
||||
await page
|
||||
.getByRole("row", { name: /변경 사용자/ })
|
||||
.getByRole("button")
|
||||
.click();
|
||||
await failedJobRow.getByRole("button").click();
|
||||
await expect.poll(() => requests).toContain("retry");
|
||||
|
||||
page.once("dialog", (dialog) => dialog.accept());
|
||||
await page.getByRole("button", { name: /대기중 payload 삭제/ }).click();
|
||||
await expect.poll(() => requests).toContain("delete-pending");
|
||||
expect(requests).toContain("download-passwords");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user