refactor(workbench): simplify appointment tasks
This commit is contained in:
@@ -47,27 +47,10 @@ const mockWorkOrder: ScheduledWorkOrderItem = {
|
||||
source: "演示",
|
||||
dispatcher: "调度中心",
|
||||
priority: "normal",
|
||||
subtasks: [{
|
||||
id: "mock-subtask-1",
|
||||
title: "现场复核",
|
||||
summary: "复核设备状态并回传。",
|
||||
status: "pending",
|
||||
scheduledAt: "2026-09-17T11:00:00+08:00",
|
||||
location: "V-1",
|
||||
assignee: "现场班组",
|
||||
durationMinutes: 30,
|
||||
replyWindowMinutes: 15,
|
||||
stages: [{
|
||||
id: "dispatch",
|
||||
sequence: 1,
|
||||
title: "派发",
|
||||
status: "current",
|
||||
owner: "调度中心",
|
||||
timeLabel: "10:45",
|
||||
description: "派发现场复核任务。"
|
||||
}],
|
||||
replyRequirements: ["回传设备状态"]
|
||||
}]
|
||||
location: "V-1",
|
||||
assignee: "现场班组",
|
||||
feedbackRequirements: ["回传设备状态"],
|
||||
activity: []
|
||||
};
|
||||
|
||||
describe("workbench runtime data", () => {
|
||||
@@ -109,13 +92,13 @@ describe("workbench runtime data", () => {
|
||||
expect(resolved.workOrderDataSource).toBe("none");
|
||||
});
|
||||
|
||||
it("keeps explicit demo work orders visible without treating them as backend fallback", () => {
|
||||
it("does not use frontend demo work orders as a backend fallback", () => {
|
||||
const demoWorkOrder = { ...mockWorkOrder, dataSource: "mock" as const };
|
||||
const resolved = resolveWorkbenchRuntimeData([mockCondition, demoWorkOrder], null, {
|
||||
operationalDate: SEPTEMBER_17
|
||||
});
|
||||
|
||||
expect(resolved.scheduledConditions).toEqual([mockCondition, demoWorkOrder]);
|
||||
expect(resolved.scheduledConditions).toEqual([mockCondition]);
|
||||
expect(resolved.workOrderDataSource).toBe("none");
|
||||
});
|
||||
|
||||
@@ -276,7 +259,7 @@ describe("workbench runtime data", () => {
|
||||
expect(resolved.runtimeDataSource).toBe("mock");
|
||||
});
|
||||
|
||||
it("keeps explicit demo appointments when an explicit backend day has no work orders", () => {
|
||||
it("treats an empty configured backend work-order partition as authoritative", () => {
|
||||
const resolved = resolveWorkbenchRuntimeData([mockCondition, mockWorkOrder], {
|
||||
availability: "ready",
|
||||
source: "none",
|
||||
@@ -294,7 +277,7 @@ describe("workbench runtime data", () => {
|
||||
workOrders: []
|
||||
}, { operationalDate: SEPTEMBER_17, runtimeMode: "backend" });
|
||||
|
||||
expect(resolved.scheduledConditions).toEqual([mockCondition, mockWorkOrder]);
|
||||
expect(resolved.scheduledConditions).toEqual([mockCondition]);
|
||||
expect(resolved.runtimeDataSource).toBe("mock");
|
||||
expect(resolved.workOrderDataSource).toBe("backend");
|
||||
});
|
||||
@@ -379,7 +362,7 @@ describe("workbench runtime data", () => {
|
||||
|
||||
expect(resolved.workbenchAlerts).toEqual([backendAlert]);
|
||||
expect(resolved.alertDataSource).toBe("backend");
|
||||
expect(resolved.scheduledConditions).toEqual([mockCondition, mockWorkOrder, backendWorkOrder]);
|
||||
expect(resolved.scheduledConditions).toEqual([mockCondition, backendWorkOrder]);
|
||||
expect(resolved.workOrderDataSource).toBe("backend");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user