feat(workbench): add manual task refresh
This commit is contained in:
@@ -197,13 +197,15 @@ test("审批动作展示中文参数和证据,viewer 不可审批,冲突后
|
||||
alert_availability: "not_configured", generated_at: "2026-09-23T08:30:00Z",
|
||||
conditions: [], alerts: [], scenarios: [], latest_analysis: null, work_orders: []
|
||||
};
|
||||
await page.route("http://server.test/api/v1/workbench/sync-snapshot", (route) =>
|
||||
route.fulfill({ json: {
|
||||
let snapshotRequests = 0;
|
||||
await page.route("http://server.test/api/v1/workbench/sync-snapshot", (route) => {
|
||||
snapshotRequests += 1;
|
||||
return route.fulfill({ json: {
|
||||
schema: "workbench-sync-snapshot@1", event_cursor: 0, runtime: runtimeSnapshot,
|
||||
tasks: [summary(task), summary(appointmentTask)], notifications: [],
|
||||
generated_at: "2026-09-23T08:30:00Z"
|
||||
} })
|
||||
);
|
||||
} });
|
||||
});
|
||||
await page.route("http://server.test/api/v1/workbench/events**", (route) =>
|
||||
route.fulfill({ contentType: "text/event-stream", body: ": test keepalive\n\n" })
|
||||
);
|
||||
@@ -267,6 +269,10 @@ test("审批动作展示中文参数和证据,viewer 不可审批,冲突后
|
||||
await expect(conditionPanel.getByRole("button", { name: /定时任务/ })).toContainText("模拟数据");
|
||||
await expect(conditionPanel.getByRole("button", { name: /调查任务/ })).toContainText("后端");
|
||||
await expect(conditionPanel.getByRole("button", { name: /预约任务/ })).toContainText("后端");
|
||||
const conditionRefreshButton = conditionPanel.getByRole("button", { name: "刷新工况任务" });
|
||||
await expect(conditionRefreshButton).toBeVisible();
|
||||
await conditionRefreshButton.click();
|
||||
await expect.poll(() => snapshotRequests).toBe(2);
|
||||
await conditionPanel.getByRole("button", { name: "配置定时流程" }).click();
|
||||
await conditionPanel.getByLabel("定时流程名称").fill("夜间阀门巡检");
|
||||
await conditionPanel.getByLabel("任务说明").fill("每十五分钟检查预约维修涉及的边界阀门。");
|
||||
|
||||
Reference in New Issue
Block a user