refactor(workbench): simplify appointment tasks

This commit is contained in:
2026-09-24 12:01:11 +08:00
parent 436d5500f1
commit ddf953b641
28 changed files with 443 additions and 1384 deletions
@@ -1,5 +1,5 @@
import { expect, test, type Locator, type Page } from "@playwright/test";
import { mockHierarchicalWorkOrder } from "./support/mock-hierarchical-work-order";
import { mockFlatWorkOrder } from "./support/mock-hierarchical-work-order";
test("scheduled conditions keep acrylic blur outside transformed ancestors", async ({ page }) => {
await page.goto("/", { waitUntil: "domcontentloaded" });
@@ -168,7 +168,7 @@ test("switching conditions keeps the detail viewport fully expanded", async ({ p
test("keeps execution spinners without breathing badges after selecting timeline tasks", async ({
page
}) => {
await mockHierarchicalWorkOrder(page, "execution");
await mockFlatWorkOrder(page, "execution");
await page.goto("/", { waitUntil: "domcontentloaded" });
await openConditionFeed(page);
@@ -200,16 +200,15 @@ test("keeps execution spinners without breathing badges after selecting timeline
await executingWorkOrder.click();
await expectRunningStatusAnimations(executingWorkOrder);
const detail = panel.getByTestId("scheduled-condition-detail-scroll");
await expect(detail.getByText("子任务", { exact: true })).toBeVisible();
await expect(detail.getByText("1/3 完成", { exact: true })).toBeVisible();
await expect(detail.getByText("预约工单", { exact: true }).last()).toBeVisible();
await expect(detail.getByText("回执要求", { exact: true })).toBeVisible();
await expect(detail.getByText(/上传阀门操作前后照片/).first()).toBeVisible();
const activeSubtask = detail.locator("details").filter({ hasText: "记录最终开度" });
await expect(activeSubtask).toHaveAttribute("open", "");
await expect(activeSubtask.getByText("执行中", { exact: true })).toBeVisible();
await expect(detail.getByText("活动记录", { exact: true })).toBeVisible();
await expect(detail.locator("details")).toHaveCount(0);
});
test("shows completed field work as a static waiting-for-reply state", async ({ page }) => {
await mockHierarchicalWorkOrder(page, "reply");
await mockFlatWorkOrder(page, "reply");
await page.goto("/", { waitUntil: "domcontentloaded" });
await openConditionFeed(page);
@@ -236,8 +235,8 @@ test("shows completed field work as a static waiting-for-reply state", async ({
);
await awaitingReplyWorkOrder.click();
await expect(panel.getByText("2/3 完成", { exact: true })).toBeVisible();
await expect(panel.getByText("确认模型边界已同步更新 · 待复令", { exact: true })).toBeVisible();
await expect(panel.getByText("确认模型边界已同步更新", { exact: true })).toBeVisible();
await expect(panel.getByText("活动记录", { exact: true })).toBeVisible();
await expect(
panel
.getByTestId("scheduled-condition-detail-scroll")