H1-H10 优化OCR实时体验闭环
这个提交包含在:
@@ -354,6 +354,8 @@ async function mockApis(page: Page, state: ReturnType<typeof buildReimbursementS
|
||||
uploadAction: "create",
|
||||
unavailableReason: null,
|
||||
unavailableMessage: null,
|
||||
availabilityReason: "pending_ocr",
|
||||
availabilityMessage: "发票正在识别,完成后会自动刷新",
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -368,6 +370,8 @@ async function mockApis(page: Page, state: ReturnType<typeof buildReimbursementS
|
||||
status: stillPending ? "pending_ocr" : "available",
|
||||
reason: stillPending ? "pending_ocr" : "available",
|
||||
message: stillPending ? "发票正在识别" : "发票可添加",
|
||||
availabilityReason: stillPending ? "pending_ocr" : "available",
|
||||
availabilityMessage: stillPending ? "发票正在识别" : "发票可添加",
|
||||
invoiceCode: stillPending ? null : "044002600111",
|
||||
invoiceNumber: stillPending ? null : "12345678",
|
||||
invoiceDate: stillPending ? null : "2026-05-08",
|
||||
@@ -515,7 +519,7 @@ test.describe("R111 国内报销发票与附件双端体验", () => {
|
||||
buffer: Buffer.from("%PDF r111 invoice"),
|
||||
});
|
||||
await page.getByTestId("reimbursement-invoice-upload-submit").click();
|
||||
await expect(page.getByText("发票上传完成:1 张已添加")).toBeVisible({ timeout: 10_000 });
|
||||
await expect(page.getByText("已添加 1 张发票")).toBeVisible({ timeout: 15_000 });
|
||||
expect(state.statusPollCount).toBeGreaterThanOrEqual(1);
|
||||
|
||||
await page.keyboard.press("Escape");
|
||||
@@ -588,8 +592,20 @@ test.describe("R111 国内报销发票与附件双端体验", () => {
|
||||
await expect(invoiceDialog.getByText("暂无可添加发票")).toBeVisible();
|
||||
|
||||
await invoiceDialog.getByRole("button", { name: "上传" }).click();
|
||||
await expect(invoiceDialog.getByText("拍照或选图片")).toBeVisible();
|
||||
await expect(invoiceDialog.getByText("选择 PDF/文件")).toBeVisible();
|
||||
await expect(mobile.page.getByTestId("reimbursement-invoice-upload-file")).toHaveAttribute("accept", "image/*");
|
||||
await expect(mobile.page.getByTestId("reimbursement-invoice-upload-file")).toHaveAttribute("capture", "environment");
|
||||
await expect(mobile.page.getByTestId("reimbursement-invoice-upload-document")).toHaveAttribute(
|
||||
"accept",
|
||||
/application\/pdf/,
|
||||
);
|
||||
await expect(mobile.page.getByTestId("reimbursement-invoice-upload-document")).not.toHaveAttribute(
|
||||
"capture",
|
||||
/.+/,
|
||||
);
|
||||
|
||||
await mobile.page.getByTestId("reimbursement-invoice-upload-file").setInputFiles({
|
||||
await mobile.page.getByTestId("reimbursement-invoice-upload-document").setInputFiles({
|
||||
name: "北京悦海堂发票.pdf",
|
||||
mimeType: "application/pdf",
|
||||
buffer: Buffer.from("%PDF r111 mobile invoice"),
|
||||
|
||||
在新工单中引用
屏蔽一个用户