fix: align scope picker with catalog toolbar

This commit is contained in:
yuxuanhui
2026-09-12 13:21:08 +08:00
parent 8981c24fda
commit ed349693db
6 changed files with 78 additions and 17 deletions
+20
View File
@@ -219,6 +219,26 @@ test("目录表格保持紧凑行高、截断和固定分页", async ({ page })
await expect(
table.locator(".semi-tag").filter({ hasText: "已同步字段" }),
).toBeVisible();
const summary = page
.getByRole("toolbar", { name: "数据目录表格工具栏" })
.locator(".scope-picker-summary");
const summaryBox = await summary.boundingBox();
const filterBox = await page
.getByRole("button", { name: "筛选数据目录", exact: true })
.boundingBox();
expect(
Math.abs(
summaryBox!.y +
summaryBox!.height / 2 -
filterBox!.y -
filterBox!.height / 2,
),
).toBeLessThan(3);
const textBox = await summary.locator(":scope > div").boundingBox();
const changeBox = await summary
.getByRole("button", { name: "更改组合" })
.boundingBox();
expect(changeBox!.x - textBox!.x - textBox!.width).toBeLessThanOrEqual(16);
await page.screenshot({ path: "test-results/catalog-table-layout.png" });
await page
.getByRole("navigation", { name: "主导航" })