P2FINV1 收口付款批次启用前硬化

这个提交包含在:
2026-05-16 10:07:18 +08:00
父节点 f3492b2463
当前提交 53251010c2
共修改 5 个文件,包含 44 行新增和 8 行删除
@@ -90,11 +90,16 @@ test("E2E 报销支付批次主链路:提交 -> 审批 -> 创建批次 -> 复
await page.goto(`/reimbursements/${reimbursementId}`);
await reimbursementDetail.assertLoaded();
await reimbursementDetail.submitReimbursement();
await expect(page.getByText(/状态:(reviewing|审批中)/)).toBeVisible();
const reimbursementAfterSubmit = await apiGetData<{ formNumber: string | null; totalAmount: string | null }>(
const reimbursementAfterSubmit = await apiGetData<{
formNumber: string | null;
status: string;
totalAmount: string | null;
}>(
employeeApi.api,
`/api/reimbursements/${reimbursementId}`,
);
expect(reimbursementAfterSubmit.status).toBe("reviewing");
await expect(page.getByText("审批中", { exact: true }).first()).toBeVisible();
const reimbursementDisplayCode = reimbursementAfterSubmit.formNumber ?? reimbursementId;
const secondApprovalUser = Number(reimbursementAfterSubmit.totalAmount ?? 0) > 500 ? FINANCE_MGR : FINANCE;
@@ -108,7 +113,8 @@ test("E2E 报销支付批次主链路:提交 -> 审批 -> 创建批次 -> 复
await managerTaskRow.getByTestId(TEST_IDS.workflow.detailLink).click();
await workflowDetail.assertLoaded();
await workflowDetail.approve();
await expect(workflowDetail.summary).toContainText(/状态:(已处理|completed|已完成)/);
await expect(page.getByText("已完成", { exact: true }).first()).toBeVisible();
await expect(page.getByText(`通过 · ${MANAGER.name}`, { exact: true })).toBeVisible();
await logout(page, MANAGER.name);
@@ -120,7 +126,8 @@ test("E2E 报销支付批次主链路:提交 -> 审批 -> 创建批次 -> 复
await financeTaskRow.getByTestId(TEST_IDS.workflow.detailLink).click();
await workflowDetail.assertLoaded();
await workflowDetail.approve();
await expect(workflowDetail.summary).toContainText(/状态:(已处理|completed|已完成)/);
await expect(page.getByText("已完成", { exact: true }).first()).toBeVisible();
await expect(page.getByText(`通过 · ${secondApprovalUser.name}`, { exact: true })).toBeVisible();
await logout(page, secondApprovalUser.name);
await login(page, FINANCE);
@@ -174,12 +181,26 @@ test("E2E 报销支付批次主链路:提交 -> 审批 -> 创建批次 -> 复
const executedBatchDetailCard = page.locator(".card-std").filter({ hasText: batchName }).filter({ hasText: "复核进度:" }).last();
await expect(executedBatchDetailCard).toBeVisible();
await expect(executedBatchDetailCard).toContainText("复核进度:1/1");
const executeBatchResponsePromise = page.waitForResponse((response) => {
const url = new URL(response.url());
return response.request().method() === "POST" &&
url.pathname === `/api/payment-batches/${batchId}/execute` &&
response.ok();
});
await executedBatchDetailCard.getByRole("button", { name: "执行" }).click();
await expect(page.getByTestId("action-confirm-dialog")).toContainText("确认后将执行付款批次");
await page.getByTestId("action-confirm-submit").click();
await executeBatchResponsePromise;
await expect(executedBatchDetailCard).toContainText("状态:已执行", { timeout: 30_000 });
await page.goto(`/reimbursements/${reimbursementId}`);
await reimbursementDetail.assertLoaded();
await expect(page.getByText(/状态:(paid|已支付)/)).toBeVisible({ timeout: 30_000 });
const reimbursementAfterPayment = await apiGetData<{ status: string }>(
employeeApi.api,
`/api/reimbursements/${reimbursementId}`,
);
expect(reimbursementAfterPayment.status).toBe("paid");
await expect(page.getByText("已支付", { exact: true }).first()).toBeVisible({ timeout: 30_000 });
await expect(page.getByTestId("reimbursement-payment-status")).toContainText("已付款");
const paymentAudit = await apiGetData<{