修复审批按钮布局测试跨帧测量(09-17-company-loan-principal-repayment)

两个同排按钮在同一次浏览器执行中测量,保留纵坐标严格相等及原高度差断言,不修改报销或资金业务规则。

定向审批浏览器验证 21/21 通过,零重试;任务与治理检查通过。原 7a48a1e7 正式门禁失败记录保留,新候选待重跑完整门禁。

真实建行材料、人员核实与独立业务验收仍待完成;本次仅本地提交,不推送、不部署。
这个提交包含在:
2026-10-08 08:30:38 +08:00
父节点 7a48a1e76f
当前提交 1dd840655b
共修改 2 个文件,包含 22 行新增和 2 行删除
@@ -522,8 +522,16 @@ test.describe("R7E 审批动作二次确认", () => {
await expect(primaryActions.getByRole("button")).toHaveCount(2);
await expect(primaryActions.getByRole("button", { name: "通过" })).toBeVisible();
await expect(primaryActions.getByRole("button", { name: "退回修改" })).toBeVisible();
const approveBox = await page.getByTestId("workflow-task-approve").boundingBox();
const returnBox = await page.getByTestId("workflow-task-return-toggle").boundingBox();
// Read both rectangles in one browser task: page-reveal moves their shared
// ancestor, so sequential boundingBox calls can observe different frames.
const [approveBox, returnBox] = await primaryActions.evaluate((element) => (
["workflow-task-approve", "workflow-task-return-toggle"].map((testId) => {
const button = element.querySelector(`[data-testid="${testId}"]`);
if (!button) return null;
const { y, height } = button.getBoundingClientRect();
return { y, height };
})
));
expect(approveBox).not.toBeNull();
expect(returnBox).not.toBeNull();
expect(Math.abs(approveBox!.height - returnBox!.height)).toBeLessThanOrEqual(1);