恢复付款入口与常开基线(08-01-reimbursement-notification-progress-clarity)
这个提交包含在:
@@ -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());
|
||||
|
||||
在新工单中引用
屏蔽一个用户