fix: distinguish awaiting work order replies

This commit is contained in:
2026-07-27 14:58:29 +08:00
parent f8c79a2af3
commit ade88b4fbf
9 changed files with 143 additions and 49 deletions
@@ -128,6 +128,19 @@ test.describe("mobile workbench sheet", () => {
await expect(sheet.getByRole("button", { name: "收起工况任务" })).toBeVisible();
});
test("keeps the waiting-for-reply state readable in the narrow sheet", async ({ page }) => {
await page.goto("/", { waitUntil: "domcontentloaded" });
await page.getByRole("button", { name: "打开工况任务" }).click();
const sheet = page.getByRole("region", { name: "工况任务抽屉" });
const awaitingReplyWorkOrder = sheet
.locator('button[aria-pressed]')
.filter({ hasText: "系统工单:泵站边界复核复令" });
await expect(awaitingReplyWorkOrder.getByText("待复令", { exact: true })).toBeVisible();
await awaitingReplyWorkOrder.click();
await expect(sheet.getByText("当前阶段:待复令", { exact: true })).toBeVisible();
});
test("clears mobile sheet state when crossing into the desktop layout", async ({ page }) => {
await page.goto("/", { waitUntil: "domcontentloaded" });
await page.getByRole("button", { name: "打开 Agent 面板" }).click();
@@ -82,6 +82,24 @@ test("narrow desktop keeps Agent and expanded conditions from overlapping", asyn
await expect(agentPanel).toBeVisible();
});
test("shows completed field work as a static waiting-for-reply state", async ({ page }) => {
await page.goto("/", { waitUntil: "domcontentloaded" });
const panel = page.getByRole("region", { name: "工况任务", exact: true });
await panel.getByRole("button", { name: "展开工况任务" }).click();
const awaitingReplyWorkOrder = panel
.getByTestId("scheduled-condition-timeline")
.locator('button[aria-pressed]')
.filter({ hasText: "系统工单:泵站边界复核复令" });
await expect(awaitingReplyWorkOrder.getByText("待复令", { exact: true })).toBeVisible();
await expect(awaitingReplyWorkOrder.locator(".animate-spin")).toHaveCount(0);
await expect(awaitingReplyWorkOrder.locator(".bg-orange-50")).toBeVisible();
await awaitingReplyWorkOrder.click();
await expect(panel.getByText("当前阶段:待复令", { exact: true })).toBeVisible();
});
async function expectAcrylicComposition(panel: Locator) {
const composition = await panel.evaluate((element) => {
const rootStyle = getComputedStyle(element);