feat: expand intelligent investigation workspace
This commit is contained in:
@@ -6,13 +6,14 @@ import { responsesFixture } from "./support/responses-fixture";
|
||||
const block = {
|
||||
version: "answer-ui@1", block_id: "components-motion", fallback_text: "组件交互演练,不代表现场事实。",
|
||||
spec: { root: "root", elements: {
|
||||
root: { type: "Stack", props: { columns: "one", gap: "normal", intent: "report" }, children: ["result", "note", "metric", "table", "evidence", "form", "location"] },
|
||||
root: { type: "Stack", props: { columns: "one", gap: "normal", intent: "report" }, children: ["result", "note", "metric", "table", "evidence", "form", "extraForm", "location"] },
|
||||
result: { type: "Result", props: { title: "演练结果", summary: "待现场核验。", status: "unconfirmed", source: "浏览器演练" }, children: [] },
|
||||
note: { type: "Text", props: { title: "数据边界", tone: "info", text: "仅供交互验收。" }, children: [] },
|
||||
metric: { type: "Metric", props: { label: "演练入口压力", value: "0.2130", unit: "MPa", source: "浏览器演练" }, children: [] },
|
||||
table: { type: "Table", props: { title: "演练记录", columns: ["对象", "压力(MPa)"], rows: [["入口一", "0.2130"], ["入口二", "0.2870"]] }, children: [] },
|
||||
evidence: { type: "Evidence", props: { title: "演练依据", summary: "尚未核验现场事实。", source: "浏览器演练", kind: "demo", evidence_id: "DEMO-MOTION", observed_at: null }, children: [] },
|
||||
form: { type: "FollowUpForm", props: { title: "现场核验", description: "由你补充后带入对话。", fields: [{ name: "record", label: "现场记录", kind: "text", required: true }] }, children: [] },
|
||||
extraForm: { type: "FollowUpForm", props: { title: "其他核验", description: "可选补充", fields: [{ name: "extra", label: "其他记录", kind: "text", required: false }] }, children: [] },
|
||||
location: { type: "MapLocation", props: { label: "定位演练入口", layer: "junctions", feature_ids: ["DEMO-ENTRY"], source: "浏览器演练" }, children: [] },
|
||||
} },
|
||||
};
|
||||
@@ -82,17 +83,9 @@ for (const width of [1440, 320]) for (const reduce of [false, true]) {
|
||||
const location = ui.locator(".answer-ui-location");
|
||||
await location.getByRole("button", { name: "查看关联要素", exact: true }).click();
|
||||
await expect(location.getByText("DEMO-ENTRY", { exact: true })).toBeVisible();
|
||||
await ui.getByRole("checkbox", { name: "选择第 1 行", exact: true }).check();
|
||||
await ui.getByRole("button", { name: "将所选行加入分析", exact: true }).click();
|
||||
const tray = ui.getByRole("region", { name: "分析内容篮" });
|
||||
await expect(tray).toContainText("已选 1 项分析内容");
|
||||
await tray.getByRole("button", { name: "演练记录", exact: true }).click();
|
||||
await expect(tray.getByText(/对象:入口一;压力(MPa):0.2130/)).toBeVisible();
|
||||
await tray.getByRole("textbox").fill("核查演练资料");
|
||||
await ui.getByRole("button", { name: "将演练入口压力加入分析", exact: true }).click();
|
||||
await tray.getByRole("button", { name: "移除演练入口压力", exact: true }).click();
|
||||
await expect(tray.getByRole("textbox")).toHaveValue("核查演练资料");
|
||||
await expect(editor).toHaveValue("保留同一个编辑器的现场草稿");
|
||||
await expect(ui.getByRole("checkbox")).toHaveCount(0);
|
||||
await expect(ui.getByRole("button", { name: /加入分析|针对.*提问/ })).toHaveCount(0);
|
||||
await expect(ui.getByRole("region", { name: "分析内容篮" })).toHaveCount(0);
|
||||
await ui.getByRole("textbox", { name: "搜索演练记录" }).fill("不存在的入口");
|
||||
await expect(ui.getByRole("cell", { name: "当前筛选没有匹配的数据。" })).toBeVisible();
|
||||
await expect(ui.getByText("勾选数据行可加入分析或继续提问。", { exact: true })).toHaveCount(0);
|
||||
@@ -106,8 +99,7 @@ for (const width of [1440, 320]) for (const reduce of [false, true]) {
|
||||
await expect(editor).toBeVisible();
|
||||
await expect(editor).toHaveValue("保留同一个编辑器的现场草稿");
|
||||
await page.evaluate(() => document.fonts.ready);
|
||||
await ui.locator(".answer-ui-form").screenshot({ path: testInfo.outputPath(`form-${width}-${reduce}.png`) });
|
||||
await ui.getByRole("group", { name: "现场核验", exact: true }).screenshot({ path: testInfo.outputPath(`form-${width}-${reduce}.png`) });
|
||||
await evidence.screenshot({ path: testInfo.outputPath(`evidence-${width}-${reduce}.png`) });
|
||||
await tray.screenshot({ path: testInfo.outputPath(`basket-${width}-${reduce}.png`) });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user