forked from baron/baron-sso
패키징 개선
This commit is contained in:
@@ -356,12 +356,10 @@ test.describe("Worksmobile tenant management", () => {
|
||||
.getByRole("row", { name: /김누락/ })
|
||||
.getByRole("checkbox")
|
||||
.check();
|
||||
await page
|
||||
.getByRole("button", { name: "선택 구성원 WORKS에 생성" })
|
||||
.click();
|
||||
await page.getByRole("button", { name: "Works에 정보 넣기" }).click();
|
||||
await expect(page.getByText("WORKS 초기 비밀번호")).toBeVisible();
|
||||
await page.getByLabel("초기 비밀번호").fill("InitPass123!");
|
||||
await page.getByRole("button", { name: "생성 작업 등록" }).click();
|
||||
await page.getByRole("button", { name: "작업 등록" }).click();
|
||||
await expect
|
||||
.poll(() => syncRequests)
|
||||
.toEqual([
|
||||
@@ -591,11 +589,11 @@ test.describe("Worksmobile tenant management", () => {
|
||||
.check();
|
||||
|
||||
await userComparisonSection
|
||||
.getByRole("button", { name: "선택 구성원 WORKS에 생성" })
|
||||
.getByRole("button", { name: "Works에 정보 넣기" })
|
||||
.click();
|
||||
await expect(page.getByText("WORKS 초기 비밀번호")).toBeVisible();
|
||||
await page.getByLabel("초기 비밀번호").fill("InitPass123!");
|
||||
await page.getByRole("button", { name: "생성 작업 등록" }).click();
|
||||
await page.getByRole("button", { name: "작업 등록" }).click();
|
||||
await expect
|
||||
.poll(() => syncRequests)
|
||||
.toEqual([
|
||||
@@ -603,6 +601,12 @@ test.describe("Worksmobile tenant management", () => {
|
||||
userId: "user-missing",
|
||||
body: expect.objectContaining({ initialPassword: "InitPass123!" }),
|
||||
},
|
||||
{
|
||||
userId: "user-update",
|
||||
body: expect.not.objectContaining({
|
||||
initialPassword: expect.anything(),
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
const updateRowCheckbox = userComparisonSection
|
||||
@@ -614,8 +618,9 @@ test.describe("Worksmobile tenant management", () => {
|
||||
.getByRole("checkbox")
|
||||
.check();
|
||||
await userComparisonSection
|
||||
.getByRole("button", { name: "선택 구성원 업데이트 적용" })
|
||||
.getByRole("button", { name: "Works에 정보 넣기" })
|
||||
.click();
|
||||
await expect(page.getByText("WORKS 초기 비밀번호")).not.toBeVisible();
|
||||
await expect
|
||||
.poll(() => syncRequests)
|
||||
.toEqual([
|
||||
@@ -629,6 +634,12 @@ test.describe("Worksmobile tenant management", () => {
|
||||
initialPassword: expect.anything(),
|
||||
}),
|
||||
},
|
||||
{
|
||||
userId: "user-update",
|
||||
body: expect.not.objectContaining({
|
||||
initialPassword: expect.anything(),
|
||||
}),
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -734,15 +745,13 @@ test.describe("Worksmobile tenant management", () => {
|
||||
.getByRole("row", { name: /실패 사용자/ })
|
||||
.getByRole("checkbox")
|
||||
.check();
|
||||
await page
|
||||
.getByRole("button", { name: "선택 구성원 WORKS에 생성" })
|
||||
.click();
|
||||
await page.getByRole("button", { name: "Works에 정보 넣기" }).click();
|
||||
await page.getByLabel("초기 비밀번호").fill("InitPass123!");
|
||||
await page.getByRole("button", { name: "생성 작업 등록" }).click();
|
||||
await page.getByRole("button", { name: "작업 등록" }).click();
|
||||
|
||||
await expect(page.getByText("WORKS 초기 비밀번호")).toBeVisible();
|
||||
await page.getByLabel("초기 비밀번호").fill("InitPass123!");
|
||||
await page.getByRole("button", { name: "생성 작업 등록" }).click();
|
||||
await page.getByRole("button", { name: "작업 등록" }).click();
|
||||
|
||||
await expect(page.getByText("WORKS 생성 작업 등록 실패")).toBeVisible();
|
||||
await expect(
|
||||
@@ -917,6 +926,90 @@ test.describe("Worksmobile tenant management", () => {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Expose-Headers": "Content-Disposition",
|
||||
};
|
||||
const buildRecentJobs = () => [
|
||||
...(requests.includes("org-rejected-sync")
|
||||
? [
|
||||
{
|
||||
id: "job-org-rejected",
|
||||
resourceType: "ORGUNIT",
|
||||
resourceId: "org-rejected",
|
||||
action: "UPSERT",
|
||||
status: "failed",
|
||||
retryCount: 0,
|
||||
lastError: "target tenant is excluded from Worksmobile sync",
|
||||
createdAt: "2026-05-01T00:02:00Z",
|
||||
updatedAt: "2026-05-01T00:02:00Z",
|
||||
payload: {
|
||||
displayName: "제외팀",
|
||||
matchLocalPart: "excluded-team",
|
||||
requestSummary: {
|
||||
orgUnitName: "제외팀",
|
||||
orgUnitExternalKey: "org-rejected",
|
||||
tenantSlug: "excluded-team",
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
id: "job-retry",
|
||||
resourceType: "USER",
|
||||
resourceId: "user-failed",
|
||||
action: "sync",
|
||||
status: "failed",
|
||||
retryCount: 1,
|
||||
lastError: "worksmobile api failed status=400 body=invalid org",
|
||||
createdAt: "2026-05-01T00:00:00Z",
|
||||
updatedAt: "2026-05-01T00:00:00Z",
|
||||
payload: {
|
||||
loginEmail: "changed-user@example.com",
|
||||
displayName: "변경 사용자",
|
||||
primaryLeafOrgName: "인재성장",
|
||||
requestSummary: {
|
||||
email: "changed-user@example.com",
|
||||
displayName: "변경 사용자",
|
||||
userExternalKey: "user-failed",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "job-org-auto",
|
||||
resourceType: "ORGUNIT",
|
||||
resourceId: "org-auto",
|
||||
action: "UPSERT",
|
||||
status: "processed",
|
||||
retryCount: 0,
|
||||
createdAt: "2026-05-01T00:00:00Z",
|
||||
updatedAt: "2026-05-01T00:01:00Z",
|
||||
payload: {
|
||||
matchLocalPart: "people-growth",
|
||||
requestSummary: {
|
||||
orgUnitName: "인재성장",
|
||||
email: "people-growth@example.com",
|
||||
orgUnitExternalKey: "org-auto",
|
||||
parentOrgUnitId: "externalKey:parent-org",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
await page.route("**/api/v1/**", async (route) => {
|
||||
const url = new URL(route.request().url());
|
||||
@@ -948,65 +1041,7 @@ test.describe("Worksmobile tenant management", () => {
|
||||
tokenConfigured: true,
|
||||
adminTenantId: "works-tenant-1",
|
||||
},
|
||||
recentJobs: [
|
||||
{
|
||||
id: "job-retry",
|
||||
resourceType: "USER",
|
||||
resourceId: "user-failed",
|
||||
action: "sync",
|
||||
status: "failed",
|
||||
retryCount: 1,
|
||||
createdAt: "2026-05-01T00:00:00Z",
|
||||
updatedAt: "2026-05-01T00:00:00Z",
|
||||
payload: {
|
||||
loginEmail: "changed-user@example.com",
|
||||
displayName: "변경 사용자",
|
||||
primaryLeafOrgName: "인재성장",
|
||||
requestSummary: {
|
||||
email: "changed-user@example.com",
|
||||
displayName: "변경 사용자",
|
||||
userExternalKey: "user-failed",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "job-org-auto",
|
||||
resourceType: "ORGUNIT",
|
||||
resourceId: "org-auto",
|
||||
action: "UPSERT",
|
||||
status: "processed",
|
||||
retryCount: 0,
|
||||
createdAt: "2026-05-01T00:00:00Z",
|
||||
updatedAt: "2026-05-01T00:01:00Z",
|
||||
payload: {
|
||||
matchLocalPart: "people-growth",
|
||||
requestSummary: {
|
||||
orgUnitName: "인재성장",
|
||||
email: "people-growth@example.com",
|
||||
orgUnitExternalKey: "org-auto",
|
||||
parentOrgUnitId: "externalKey:parent-org",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
recentJobs: buildRecentJobs(),
|
||||
},
|
||||
headers,
|
||||
});
|
||||
@@ -1068,6 +1103,20 @@ test.describe("Worksmobile tenant management", () => {
|
||||
return route.fulfill({ json: { id: "job-org-sync" }, headers });
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/orgunits/org-rejected/sync",
|
||||
) &&
|
||||
method === "POST"
|
||||
) {
|
||||
requests.push("org-rejected-sync");
|
||||
return route.fulfill({
|
||||
status: 400,
|
||||
json: { error: "target tenant is excluded from Worksmobile sync" },
|
||||
headers,
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
url.pathname.endsWith(
|
||||
"/admin/tenants/038326b6-954a-48a7-a85f-efd83f62b82a/worksmobile/users/user-1/sync",
|
||||
@@ -1116,6 +1165,9 @@ test.describe("Worksmobile tenant management", () => {
|
||||
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.getByPlaceholder("orgUnit tenant UUID").fill("org-rejected");
|
||||
await page.getByRole("button", { name: "조직 Sync" }).click();
|
||||
await expect.poll(() => requests).toContain("org-rejected-sync");
|
||||
|
||||
await page.getByRole("tab", { name: "사용자" }).click();
|
||||
await page.getByPlaceholder("Kratos user UUID").fill("user-1");
|
||||
@@ -1123,6 +1175,10 @@ test.describe("Worksmobile tenant management", () => {
|
||||
await expect.poll(() => requests).toContain("user-sync");
|
||||
|
||||
await page.getByRole("tab", { name: "이력" }).click();
|
||||
const rejectedOrgRow = page.getByRole("row", { name: /제외팀/ });
|
||||
await expect(rejectedOrgRow).toContainText(
|
||||
"target tenant is excluded from Worksmobile sync",
|
||||
);
|
||||
await expect(page.getByRole("row", { name: /변경 사용자/ })).toContainText(
|
||||
"changed-user@example.com",
|
||||
);
|
||||
@@ -1136,6 +1192,9 @@ test.describe("Worksmobile tenant management", () => {
|
||||
.first(),
|
||||
).toBeVisible();
|
||||
const failedJobRow = page.getByRole("row", { name: /변경 사용자/ });
|
||||
await expect(failedJobRow).toContainText(
|
||||
"worksmobile api failed status=400 body=invalid org",
|
||||
);
|
||||
await failedJobRow.getByText("payload").click();
|
||||
await expect(
|
||||
failedJobRow.getByText('"loginEmail": "changed-user@example.com"'),
|
||||
|
||||
Reference in New Issue
Block a user