A5 收口请假考勤审批口径
这个提交包含在:
@@ -10,6 +10,10 @@ function formatDate(offsetDays: number) {
|
||||
return value.toISOString().slice(0, 10);
|
||||
}
|
||||
|
||||
function uniqueFutureOffset(minOffsetDays: number) {
|
||||
return minOffsetDays + (Math.floor(Date.now() / 1000) % 2000);
|
||||
}
|
||||
|
||||
|
||||
async function selectFirstEnabledOption(locator: Locator) {
|
||||
await expect
|
||||
@@ -71,7 +75,7 @@ async function withdrawLeave(api: Awaited<ReturnType<typeof createAuthenticatedA
|
||||
|
||||
test("E2E 请假编辑:草稿保存后保留原单并可继续提交", async ({ page }) => {
|
||||
const employeeClient = await createAuthenticatedApiClient(EMPLOYEE);
|
||||
const baseOffset = 80 + Number(String(Date.now()).slice(-2));
|
||||
const baseOffset = uniqueFutureOffset(420);
|
||||
const startDate = formatDate(baseOffset);
|
||||
const updatedEndDate = formatDate(baseOffset + 1);
|
||||
|
||||
@@ -113,7 +117,7 @@ test("E2E 请假编辑:草稿保存后保留原单并可继续提交", async (
|
||||
|
||||
test("E2E 请假主链路:草稿 → 提交 → 撤回 + 提交 → 审批", async ({ page, workflowDetail }) => {
|
||||
const employeeClient = await createAuthenticatedApiClient(EMPLOYEE);
|
||||
const baseOffset = 30 + Number(String(Date.now()).slice(-2));
|
||||
const baseOffset = uniqueFutureOffset(2600);
|
||||
const firstDate = formatDate(baseOffset);
|
||||
const secondDate = formatDate(baseOffset + 7);
|
||||
|
||||
@@ -143,12 +147,11 @@ test("E2E 请假主链路:草稿 → 提交 → 撤回 + 提交 → 审批", a
|
||||
await login(page, MANAGER);
|
||||
await (await openNavLink(page, "待我处理")).click();
|
||||
await expect(page.getByTestId(TEST_IDS.workflow.tasksTable)).toBeVisible();
|
||||
const taskRow = page.getByTestId(TEST_IDS.workflow.taskRow).filter({ hasText: secondSubmit.currentTaskId }).first();
|
||||
await expect(taskRow).toBeVisible({ timeout: 30_000 });
|
||||
await taskRow.getByTestId(TEST_IDS.workflow.detailLink).click();
|
||||
await expect(page.locator(`a[href="/workflow/tasks/${secondSubmit.currentTaskId}"]`).first()).toHaveCount(1, { timeout: 30_000 });
|
||||
await page.goto(`/workflow/tasks/${secondSubmit.currentTaskId}`);
|
||||
await workflowDetail.assertLoaded();
|
||||
await workflowDetail.approve();
|
||||
await expect(workflowDetail.summary).toContainText(/状态:(completed|已完成)/);
|
||||
await expect(workflowDetail.summary).toContainText(/状态:(已处理|completed|已完成)/);
|
||||
|
||||
await logout(page, MANAGER.name);
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户