feat: expand intelligent investigation workspace
This commit is contained in:
@@ -13,6 +13,7 @@ const now = "2026-09-24T08:00:00Z";
|
||||
|
||||
test("调查报告展示 SVG 脉络、处置进展和报告版本,缺数正常结束", async ({ page }, testInfo) => {
|
||||
test.setTimeout(90_000);
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
await mockAgentApi(page);
|
||||
await page.route("**/runtime-config.js", (route) => route.fulfill({ contentType: "text/javascript", body: `globalThis.__TJWATER_CONFIG__=${JSON.stringify({
|
||||
TJWATER_AUTH_MODE: "disabled", TJWATER_SERVER_API_BASE_URL: "http://server.test",
|
||||
@@ -88,7 +89,13 @@ test("调查报告展示 SVG 脉络、处置进展和报告版本,缺数正常
|
||||
work_order_snapshot: null
|
||||
};
|
||||
const firstReport = task.latest_report!;
|
||||
let notifications: OperationalTaskNotification[] = [];
|
||||
let notifications: OperationalTaskNotification[] = [{
|
||||
notification_id: "87000000-0000-4000-8000-000000000002", task_id: taskId,
|
||||
kind: "action_approval_pending", title: "待确认现场采样工单", description: "请审核派单内容",
|
||||
lifecycle_status: "active", subject_type: "action", subject_id: actionId,
|
||||
report_reference: null, resolved_at: null, resolution_reason: null,
|
||||
status: "unread", version: 1, required_permission: null, created_at: now, read_at: null, read_by: null
|
||||
}];
|
||||
const summary = (item: OperationalTask): OperationalTaskSummary => {
|
||||
const { latest_plan, latest_report, latest_progress, evidence, actions, access_requests, permissions, work_order_snapshot, ...value } = item;
|
||||
void latest_plan; void latest_report; void latest_progress; void evidence; void actions; void access_requests; void permissions; void work_order_snapshot;
|
||||
@@ -184,7 +191,7 @@ test("调查报告展示 SVG 脉络、处置进展和报告版本,缺数正常
|
||||
await expect(diagram.locator("svg[id]")).toHaveCount(1);
|
||||
await expect(diagram).toContainText("常规核查");
|
||||
const captureDiagramControls = async (surface: typeof diagram) => {
|
||||
return surface.locator("button[title]").evaluateAll((buttons) => buttons.map((button) => {
|
||||
return surface.locator("button[title]:has([data-investigation-diagram-control])").evaluateAll((buttons) => buttons.map((button) => {
|
||||
const rect = button.getBoundingClientRect();
|
||||
const style = getComputedStyle(button);
|
||||
const icon = button.querySelector("svg");
|
||||
@@ -292,22 +299,17 @@ test("调查报告展示 SVG 脉络、处置进展和报告版本,缺数正常
|
||||
|
||||
await panel.getByRole("button", { name: "Agent 协作" }).click();
|
||||
const agentPanel = page.getByRole("complementary", { name: "Agent 命令面板" });
|
||||
const review = agentPanel.getByRole("region", { name: "任务协作状态" });
|
||||
await expect(review).toContainText("现场采样需要派单");
|
||||
await expect(review.getByRole("heading", { name: "关联预约工单" })).toBeVisible();
|
||||
await expect(review).toContainText("调查任务只保留创建关联");
|
||||
await expect(review).toContainText("预约工单");
|
||||
await expect(review.getByText("数据访问申请", { exact: true })).toHaveCount(0);
|
||||
await testInfo.attach("linked-appointment-review-desktop", {
|
||||
body: await review.screenshot({ path: testInfo.outputPath("linked-appointment-review-desktop.png") }), contentType: "image/png"
|
||||
});
|
||||
await page.setViewportSize({ width: 375, height: 720 });
|
||||
const mobileAgentSheet = page.getByRole("region", { name: "Agent 工作台抽屉" });
|
||||
if (!await mobileAgentSheet.isVisible()) await page.getByRole("button", { name: "打开 Agent 面板" }).click();
|
||||
await expect(mobileAgentSheet.getByRole("region", { name: "任务协作状态" })).toBeVisible();
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBeLessThanOrEqual(375);
|
||||
await page.setViewportSize({ width: 1280, height: 720 });
|
||||
await expect(agentPanel.getByRole("region", { name: "任务协作状态" })).toHaveCount(0);
|
||||
await expect(agentPanel.getByRole("button", { name: "确认并创建预约工单" })).toHaveCount(0);
|
||||
await expect(agentPanel.getByRole("group", { name: "对话引用" })).toBeVisible();
|
||||
await agentPanel.screenshot({ path: testInfo.outputPath("discussion-without-fixed-review.png") });
|
||||
// Narrow-screen conversation layout is covered by investigation-main-chat.e2e.ts.
|
||||
await page.getByRole("button", { name: /查看待办与告警/ }).click();
|
||||
await page.getByRole("menuitem").filter({ hasText: "待确认现场采样工单" }).click();
|
||||
const pending = panel.getByLabel("当前需处理", { exact: true });
|
||||
const review = pending.locator(`[data-action-id="${actionId}"]`);
|
||||
await expect(review).toBeVisible();
|
||||
await expect(review.getByRole("heading", { name: "关联预约工单" })).toBeVisible();
|
||||
await expect(panel.getByLabel("数据访问审核")).toHaveCount(0);
|
||||
await review.getByRole("button", { name: "编辑草稿" }).click();
|
||||
await expect(review.getByRole("combobox", { name: "工单类型" })).toHaveCount(0);
|
||||
|
||||
Reference in New Issue
Block a user