修复移动验收门禁漂移(07-27-yang-jun-reimbursement-readiness)
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-08-01 16:28:14 +08:00
父节点 3bfcbbfc91
当前提交 5dac336fbf
共修改 8 个文件,包含 94 行新增和 13 行删除
@@ -1188,9 +1188,6 @@ test("Wave3 PC 详情和通知中心视觉截图", async ({ page }) => {
const contractRows = page.getByTestId("contracts-registry-table").getByTestId("contracts-registry-row");
await expect(contractRows).toHaveCount(2);
await expect(contractRows.first()).toBeVisible();
await page.locator(".ops-command-bar__actions").getByRole("button", { name: "更多" }).click();
await expect(page.getByRole("menuitem", { name: "导出 CSV" })).toBeVisible();
await page.keyboard.press("Escape");
await page.getByRole("button", { name: "筛选", exact: true }).click();
await expect(page.getByTestId("contracts-advanced-filters")).toBeVisible();
await page.getByRole("button", { name: "新增合同" }).click();
@@ -1202,6 +1199,8 @@ test("Wave3 PC 详情和通知中心视觉截图", async ({ page }) => {
await expect(page.getByTestId("action-confirm-dialog")).toContainText("确认归档");
await page.getByTestId("action-confirm-cancel").click();
await expect(page.getByTestId("action-confirm-dialog")).toHaveCount(0);
await page.locator(".ops-command-bar__actions").getByRole("button", { name: "更多" }).click();
await expect(page.getByRole("menuitem", { name: "导出 CSV" })).toBeVisible();
await page.screenshot({ path: screenshotPath("04-pc-contracts-registry.png"), fullPage: true });
});
@@ -21,6 +21,13 @@ const DEVICE_CASES = [
},
] as const;
const EXPECTED_HOME_ACTIONS = [
{ key: "new-reimbursement", label: "新建报销" },
{ key: "capture", label: "上传票据" },
{ key: "leave", label: "请假记录" },
{ key: "purchase", label: "采购" },
] as const;
const employee = {
id: "11111111-1111-4111-8111-111111111111",
employeeNo: "HYD000006",
@@ -276,10 +283,13 @@ async function collectMobileMetrics(page: Page) {
const stickyButtons = [
document.querySelector("[data-testid='reimbursement-submit']"),
].filter(Boolean).map((element) => element!.getBoundingClientRect());
const actionItems = ["approvals", "capture", "reimbursements", "me", "leave"].map((key) => {
const element = document.querySelector(`[data-testid='mobile-action-${key}']`);
const label = document.querySelector(`[data-testid='mobile-action-${key}-label']`);
const icon = document.querySelector(`[data-testid='mobile-action-${key}-icon']`);
const actionItems = Array.from(
document.querySelectorAll("[data-testid='mobile-action-grid'] > a[data-testid^='mobile-action-']"),
).map((element) => {
const testId = element.getAttribute("data-testid") ?? "";
const key = testId.replace(/^mobile-action-/, "");
const label = element.querySelector(`[data-testid='mobile-action-${key}-label']`);
const icon = element.querySelector(`[data-testid='mobile-action-${key}-icon']`);
const rect = element?.getBoundingClientRect();
const labelRect = label?.getBoundingClientRect();
const iconRect = icon?.getBoundingClientRect();
@@ -301,6 +311,7 @@ async function collectMobileMetrics(page: Page) {
labelWhiteSpace: style?.whiteSpace ?? "",
iconWidth: iconRect?.width ?? 0,
iconHeight: iconRect?.height ?? 0,
iconSvgTagName: icon?.querySelector("svg")?.tagName.toLowerCase() ?? "",
overlaps,
labelWithin:
Boolean(rect && labelRect) &&
@@ -368,7 +379,7 @@ test.describe("R5 真机反馈移动交互", () => {
expect(homeMetrics.bottomNavBottomGap).not.toBeNull();
expect(homeMetrics.bottomNavBottomGap!).toBeLessThanOrEqual(2);
expect(homeMetrics.scrollWidth).toBeLessThanOrEqual(homeMetrics.width + 2);
expect(homeMetrics.actionItems.length).toBeGreaterThanOrEqual(4);
expect(homeMetrics.actionItems.map(({ key, text }) => ({ key, label: text }))).toEqual(EXPECTED_HOME_ACTIONS);
for (const action of homeMetrics.actionItems) {
expect(action.height, `${device.label} ${action.text} action touch height`).toBeGreaterThanOrEqual(44);
expect(action.labelWhiteSpace, `${device.label} ${action.text} action label no wrap`).toBe("nowrap");
@@ -376,6 +387,7 @@ test.describe("R5 真机反馈移动交互", () => {
expect(action.labelWidth, `${device.label} ${action.text} action label readable width`).toBeGreaterThanOrEqual(20);
expect(action.iconWidth, `${device.label} ${action.text} action icon width`).toBeGreaterThanOrEqual(28);
expect(action.iconHeight, `${device.label} ${action.text} action icon height`).toBeGreaterThanOrEqual(28);
expect(action.iconSvgTagName, `${device.label} ${action.text} action uses SVG icon`).toBe("svg");
expect(action.overlaps, `${device.label} ${action.text} action label/icon overlap`).toBe(false);
expect(action.labelWithin, `${device.label} ${action.text} action label within tile`).toBe(true);
expect(action.iconWithin, `${device.label} ${action.text} action icon within tile`).toBe(true);
@@ -414,7 +426,7 @@ test.describe("R5 真机反馈移动交互", () => {
await page.goto("/mobile/reimbursements/r5-reimbursement-1");
await expect(page.getByTestId("mobile-reimbursement-detail")).toBeVisible();
await expect(page.getByTestId("mobile-nav-reimbursements")).toHaveCount(0);
await expect(page.getByRole("link", { name: "返回" })).toBeVisible();
await expect(page.getByRole("button", { name: "返回" })).toBeVisible();
await expect(page.getByTestId("mobile-reimbursement-sticky-actions")).toBeVisible();
await expect(page.getByTestId("mobile-reimbursement-sticky-invoice-add")).toHaveCount(0);
await expect(page.getByTestId("reimbursement-invoice-add")).toBeVisible();