恢复付款入口与常开基线(08-01-reimbursement-notification-progress-clarity)
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-08-01 23:12:23 +08:00
父节点 aa6b9bc373
当前提交 37b4ef2d10
共修改 20 个文件,包含 655 行新增和 244 行删除
@@ -24,6 +24,14 @@ type MockNotification = {
createdAt: string;
};
type FinanceSummaryOverride = {
pendingBatchCount: number;
failedItemCount: number;
riskCount: number;
paymentBatchEnabled: boolean;
href: string;
};
function envelope(data: unknown) {
return { requestId: "mock-dg7-mobile-information-dedupe", data };
}
@@ -453,7 +461,12 @@ function reimbursementDetail() {
};
}
async function mockApis(page: Page, role: RolePreset, notifications: MockNotification[]) {
async function mockApis(
page: Page,
role: RolePreset,
notifications: MockNotification[],
financeSummaryOverride?: FinanceSummaryOverride,
) {
await page.route((url) => url.pathname.startsWith("/api/"), async (route) => {
const request = route.request();
const url = new URL(request.url());
@@ -544,7 +557,7 @@ async function mockApis(page: Page, role: RolePreset, notifications: MockNotific
isAdminOnly: role === "admin",
},
financeSummary: isFinance
? {
? financeSummaryOverride ?? {
pendingBatchCount: 2,
failedItemCount: 1,
riskCount: 3,
@@ -889,7 +902,7 @@ test.describe("MIF7 移动信息架构整改", () => {
const target = { targetType: "payment_batch", targetId: "batch/dg7" };
expect(resolveNotificationTargetLink(target)).toBe("/payment-batches?id=batch%2Fdg7");
expect(resolveMobileNotificationTargetLink(target)).toBe("/payment-batches?id=batch%2Fdg7");
expect(resolveMobileNotificationTargetLink(target)).toBe("/mobile/payment-batches?id=batch%2Fdg7");
});
test.skip(process.env.E2E_MODE === "live", "MIF7 本地专项使用 mock 数据验证信息架构。");
@@ -1161,6 +1174,27 @@ test.describe("MIF7 移动信息架构整改", () => {
await financeMobile.context.close();
}
const firstUseFinanceMobile = await newMobilePage(browser, 390);
try {
await mockApis(firstUseFinanceMobile.page, "finance", buildNotifications(), {
pendingBatchCount: 0,
failedItemCount: 0,
riskCount: 0,
paymentBatchEnabled: true,
href: "/payment-batches",
});
await loginForMobile(firstUseFinanceMobile.page, "finance");
await firstUseFinanceMobile.page.goto("/mobile");
const financeSummary = firstUseFinanceMobile.page.getByTestId("mobile-finance-summary");
await expect(financeSummary).toBeVisible();
await expect(financeSummary).toContainText("待付款");
await expect(financeSummary.getByRole("link", { name: "进入付款" })).toHaveAttribute("href", "/mobile/payment-batches");
await financeSummary.getByRole("link", { name: "进入付款" }).click();
await expect(firstUseFinanceMobile.page).toHaveURL(/\/mobile\/payment-batches$/);
} finally {
await firstUseFinanceMobile.context.close();
}
const adminMobile = await newMobilePage(browser, 390);
try {
await mockApis(adminMobile.page, "admin", buildNotifications());