修复非参与人报销只读边界(08-28-reimbursement-nonparticipant-readonly-projection)
这个提交包含在:
@@ -452,7 +452,7 @@ test.describe("R102 reimbursement main flow", () => {
|
||||
await expect(page.getByTestId("mobile-reimbursement-items")).toContainText("报销合计 ¥168.30");
|
||||
});
|
||||
|
||||
test("管理员查看他人报销时隐藏撤回并可在移动端切换全部报销", async ({ page }) => {
|
||||
test("管理员查看他人报销时保持只读并可在移动端切换全部报销", async ({ page }) => {
|
||||
const adminMe = {
|
||||
...me,
|
||||
id: "admin-r102",
|
||||
@@ -475,11 +475,25 @@ test.describe("R102 reimbursement main flow", () => {
|
||||
...reimbursementDetail(),
|
||||
id: otherReimbursementId,
|
||||
formNumber: "BX-20260731-0002",
|
||||
status: "reviewing",
|
||||
status: "draft",
|
||||
ownerId: "employee-other-r102",
|
||||
submitterId: "employee-other-r102",
|
||||
owner: { id: "employee-other-r102", employee_no: "E103", name: "其他员工" },
|
||||
submitter: { id: "employee-other-r102", employee_no: "E103", name: "其他员工" },
|
||||
invoices: [{
|
||||
id: "invoice-other-r102",
|
||||
status: "bound",
|
||||
invoiceCode: "SYNTHETIC",
|
||||
invoiceNumber: "R102-OTHER",
|
||||
invoiceDate: "2026-07-31",
|
||||
sellerName: "合成供应方",
|
||||
buyerName: "合成购买方",
|
||||
totalAmount: "168.30",
|
||||
originalName: "合成发票.pdf",
|
||||
mimeType: "application/pdf",
|
||||
fileSize: 1024,
|
||||
linkedItemId: null,
|
||||
}],
|
||||
});
|
||||
});
|
||||
await page.route((url) => url.pathname === "/api/reimbursements", async (route) => {
|
||||
@@ -515,6 +529,13 @@ test.describe("R102 reimbursement main flow", () => {
|
||||
await expect(page.getByTestId("reimbursement-overview")).toBeVisible();
|
||||
await expect(page.getByTestId("reimbursement-withdraw")).toHaveCount(0);
|
||||
await expect(page.getByTestId("reimbursement-withdraw-comment")).toHaveCount(0);
|
||||
await expect(page.getByText("只读查看")).toBeVisible();
|
||||
await expect(page.getByText("等待报销人完善")).toBeVisible();
|
||||
await expect(page.getByTestId("reimbursement-item-add")).toHaveCount(0);
|
||||
await expect(page.getByRole("combobox", { name: "关联项目" })).toHaveCount(0);
|
||||
await expect(page.getByTestId("reimbursement-invoices")).toContainText("明细:未关联");
|
||||
await expect(page.getByTestId("reimbursement-invoices")).toContainText("已关联");
|
||||
await expect(page.getByText("草稿或驳回状态可移除")).toHaveCount(0);
|
||||
|
||||
await page.setViewportSize({ width: 375, height: 812 });
|
||||
await page.goto("/mobile/reimbursements?status=reviewing");
|
||||
@@ -543,6 +564,11 @@ test.describe("R102 reimbursement main flow", () => {
|
||||
|
||||
await page.getByText("其他员工").click();
|
||||
await expect(page).toHaveURL(new RegExp(`/mobile/reimbursements/${otherReimbursementId}$`));
|
||||
await expect(page.getByText("只读查看")).toBeVisible();
|
||||
await expect(page.getByTestId("mobile-reimbursement-items").getByRole("button", { name: "新增" })).toHaveCount(0);
|
||||
await expect(page.getByTestId("reimbursement-invoices")).toContainText("明细:未关联");
|
||||
await expect(page.getByTestId("reimbursement-invoices")).toContainText("已关联");
|
||||
await expect(page.getByRole("button", { name: "移除" })).toHaveCount(0);
|
||||
const routeState = await page.evaluate(() => window.history.state?.usr ?? null);
|
||||
expect(routeState?.from).toContain("status=reviewing");
|
||||
expect(routeState?.from).toContain("scope=all");
|
||||
|
||||
在新工单中引用
屏蔽一个用户