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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user