收敛报销退回动作与审批布局 [09-04-approval-return-reject-actions]
这个提交包含在:
@@ -458,6 +458,7 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
submitter: { id: "owner", employeeNo: "E001", name: "申请人" },
|
||||
},
|
||||
leaveRequest: null,
|
||||
allowedActions: ["approve", "return", "transfer"],
|
||||
history: Array.from({ length: 6 }, (_, index) => ({
|
||||
id: `history-${index + 1}`,
|
||||
action: index === 0 ? "submit" : "approve",
|
||||
@@ -515,8 +516,18 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
await expect(actionPanel.getByText(/^审批角色:/)).toHaveCount(0);
|
||||
await expect(page.getByTestId("workflow-task-approve")).toBeEnabled();
|
||||
await expect(page.getByTestId("workflow-task-return-toggle")).toBeEnabled();
|
||||
await expect(page.getByTestId("workflow-task-reject-toggle")).toBeEnabled();
|
||||
await expect(page.getByTestId("workflow-task-reject-toggle")).toHaveCount(0);
|
||||
await expect(page.getByTestId("workflow-task-transfer-menu-item")).toBeEnabled();
|
||||
const primaryActions = page.getByTestId("reimbursement-approval-primary-actions");
|
||||
await expect(primaryActions.getByRole("button")).toHaveCount(2);
|
||||
await expect(primaryActions.getByRole("button", { name: "通过" })).toBeVisible();
|
||||
await expect(primaryActions.getByRole("button", { name: "退回修改" })).toBeVisible();
|
||||
const approveBox = await page.getByTestId("workflow-task-approve").boundingBox();
|
||||
const returnBox = await page.getByTestId("workflow-task-return-toggle").boundingBox();
|
||||
expect(approveBox).not.toBeNull();
|
||||
expect(returnBox).not.toBeNull();
|
||||
expect(Math.abs(approveBox!.height - returnBox!.height)).toBeLessThanOrEqual(1);
|
||||
expect(approveBox!.y).toBe(returnBox!.y);
|
||||
await expect(page.getByTestId("reimbursement-workflow-history").locator(".detail-timeline-item")).toHaveCount(6);
|
||||
await expect(page.getByRole("heading", { name: "处理历史" })).toHaveCount(1);
|
||||
const actionBox = await actionPanel.boundingBox();
|
||||
@@ -544,7 +555,7 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
await expect(page.getByTestId("workflow-task-return-comment")).toHaveValue(/【明细:交通费 · 2026-09-01 · ¥180\.00】/);
|
||||
});
|
||||
|
||||
test("PC 报销内容加载失败时四类审批入口 fail closed", async ({ page }) => {
|
||||
test("PC 报销内容加载失败时全部可见审批入口 fail closed", async ({ page }) => {
|
||||
const taskDetail = {
|
||||
...pendingTaskDetail,
|
||||
workflowInstance: {
|
||||
@@ -558,6 +569,7 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
owner: { id: "owner", employeeNo: "E001", name: "申请人" }, submitter: { id: "owner", employeeNo: "E001", name: "申请人" },
|
||||
},
|
||||
leaveRequest: null,
|
||||
allowedActions: ["approve", "return", "transfer"],
|
||||
};
|
||||
await mockWorkflowConfirmApis(page, { taskDetail, reimbursementDetailFailure: true });
|
||||
|
||||
@@ -566,7 +578,7 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
await expect(page.getByRole("alert")).toContainText("报销内容未加载完整,暂不能审批,请刷新后重试");
|
||||
await expect(page.getByTestId("workflow-task-approve")).toBeDisabled();
|
||||
await expect(page.getByTestId("workflow-task-return-toggle")).toBeDisabled();
|
||||
await expect(page.getByTestId("workflow-task-reject-toggle")).toBeDisabled();
|
||||
await expect(page.getByTestId("workflow-task-reject-toggle")).toHaveCount(0);
|
||||
await expect(page.getByTestId("workflow-task-transfer-menu-item")).toBeDisabled();
|
||||
});
|
||||
|
||||
@@ -590,6 +602,7 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
submitter: { id: "owner", employeeNo: "E001", name: "申请人" },
|
||||
},
|
||||
leaveRequest: null,
|
||||
allowedActions: ["approve", "return", "transfer"],
|
||||
history: Array.from({ length: 6 }, (_, index) => ({
|
||||
id: `mobile-history-${index + 1}`,
|
||||
action: index === 0 ? "submit" : "approve",
|
||||
@@ -627,6 +640,10 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
await expect(page.getByTestId("reimbursement-amount-summary")).toContainText("¥100.00");
|
||||
await expect(page.locator("#reimbursement-workspace-snapshot")).toHaveCount(0);
|
||||
await expect(page.getByTestId("reimbursement-workflow-history").locator(".detail-timeline-item")).toHaveCount(6);
|
||||
const stickyActions = page.getByTestId("mobile-approvals-sticky-actions");
|
||||
await expect(stickyActions.getByRole("button", { name: "退回修改" })).toBeVisible();
|
||||
await expect(stickyActions.getByRole("button", { name: "通过" })).toBeVisible();
|
||||
await expect(page.getByTestId("mobile-approvals-reject")).toHaveCount(0);
|
||||
const assertMobileGeometry = async () => {
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth <= document.documentElement.clientWidth + 2)).toBe(true);
|
||||
const lastHistory = page.getByTestId("reimbursement-workflow-history").locator(".detail-timeline-item").last();
|
||||
@@ -657,7 +674,7 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
expectedMessage: "明细金额无法完整核对,请联系管理员",
|
||||
},
|
||||
]) {
|
||||
test(`PC 报销${scenario.name}时四类审批入口 fail closed`, async ({ page }) => {
|
||||
test(`PC 报销${scenario.name}时全部可见审批入口 fail closed`, async ({ page }) => {
|
||||
const reimbursementId = `reimbursement-integrity-${scenario.itemAmount === "invalid" ? "unavailable" : "mismatch"}`;
|
||||
const taskDetail = {
|
||||
...pendingTaskDetail,
|
||||
@@ -677,6 +694,7 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
submitter: { id: "owner", employeeNo: "E001", name: "申请人" },
|
||||
},
|
||||
leaveRequest: null,
|
||||
allowedActions: ["approve", "return", "transfer"],
|
||||
};
|
||||
const reimbursementDetail = {
|
||||
id: reimbursementId,
|
||||
@@ -716,7 +734,7 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
await expect(page.getByText("差额", { exact: true })).toHaveCount(0);
|
||||
await expect(page.getByTestId("workflow-task-approve")).toBeDisabled();
|
||||
await expect(page.getByTestId("workflow-task-return-toggle")).toBeDisabled();
|
||||
await expect(page.getByTestId("workflow-task-reject-toggle")).toBeDisabled();
|
||||
await expect(page.getByTestId("workflow-task-reject-toggle")).toHaveCount(0);
|
||||
await expect(page.getByTestId("workflow-task-transfer-menu-item")).toBeDisabled();
|
||||
});
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户