fix(workbench): suppress unconfigured demo alerts

The not_configured branch previously promoted mock task failures into critical alerts. Return an explicit empty alert source so the exception badge reflects only actionable backend state.
This commit is contained in:
2026-09-24 15:13:14 +08:00
parent 7e969e7e8c
commit a5e5acb03b
5 changed files with 24 additions and 11 deletions
@@ -66,7 +66,7 @@ describe("workbench runtime data", () => {
expect(getMsUntilNextHeaderDataTimeTick(new Date(2026, 6, 22, 15, 43, 30))).toBe(90_000);
});
it("keeps mock conditions and shows no work orders when backend storage is not configured", () => {
it("keeps mock conditions without inventing alerts when backend storage is not configured", () => {
const resolved = resolveWorkbenchRuntimeData([mockCondition], {
availability: "not_configured",
source: "none",
@@ -86,7 +86,8 @@ describe("workbench runtime data", () => {
expect(resolved.runtimeDataSource).toBe("mock");
expect(resolved.scheduledConditions).toEqual([mockCondition]);
expect(resolved.workbenchAlerts).toHaveLength(1);
expect(resolved.workbenchAlerts).toEqual([]);
expect(resolved.alertDataSource).toBe("none");
expect(resolved.scenarioDataSource).toBe("mock");
expect(resolved.artifactDataSource).toBe("mock");
expect(resolved.workOrderDataSource).toBe("none");
@@ -132,9 +133,8 @@ describe("workbench runtime data", () => {
expect(resolved.runtimeDataSource).toBe("mock");
expect(resolved.scheduledConditions).toEqual([mockCondition]);
expect(resolved.workbenchAlerts).not.toEqual([backendAlert]);
expect(resolved.workbenchAlerts[0]?.id).toBe("scheduled-condition-alert-mock-condition");
expect(resolved.alertDataSource).toBe("mock");
expect(resolved.workbenchAlerts).toEqual([]);
expect(resolved.alertDataSource).toBe("none");
expect(resolved.scenarioDataSource).toBe("mock");
expect(resolved.workOrderDataSource).toBe("none");