test: check task json items

This commit is contained in:
Shakker
2026-05-11 20:15:19 +01:00
parent 51b73b39a8
commit 1461b748d8
2 changed files with 30 additions and 15 deletions

View File

@@ -100,13 +100,21 @@ describe("flows commands", () => {
expect(payload.count).toBe(1);
expect(payload.status).toBe("blocked");
expect(payload.flows).toHaveLength(1);
expect(payload.flows[0]?.flowId).toBe(flow.flowId);
expect(payload.flows[0]?.taskSummary.total).toBe(1);
expect(payload.flows[0]?.taskSummary.active).toBe(1);
expect(payload.flows[0]?.tasks).toHaveLength(1);
expect(payload.flows[0]?.tasks[0]?.runId).toBe("run-child-1");
expect(payload.flows[0]?.tasks[0]?.label).toBe("Inspect PR 123");
expect(payload.flows).toStrictEqual([
expect.objectContaining({
flowId: flow.flowId,
taskSummary: expect.objectContaining({
total: 1,
active: 1,
}),
tasks: [
expect.objectContaining({
runId: "run-child-1",
label: "Inspect PR 123",
}),
],
}),
]);
});
});

View File

@@ -85,10 +85,14 @@ describe("tasks JSON commands", () => {
expect(payload.count).toBe(1);
expect(payload.runtime).toBe("cli");
expect(payload.status).toBe("running");
expect(payload.tasks).toHaveLength(1);
expect(payload.tasks[0]?.runtime).toBe("cli");
expect(payload.tasks[0]?.status).toBe("running");
expect(payload.tasks[0]?.runId).toBe("run-cli");
expect(payload.tasks).toStrictEqual([
expect.objectContaining({
runtime: "cli",
status: "running",
runId: "run-cli",
task: "Inspect issue backlog",
}),
]);
});
});
@@ -147,10 +151,13 @@ describe("tasks JSON commands", () => {
expect(payload.summary.taskFlows.byCode.stale_waiting).toBe(1);
expect(payload.summary.taskFlows.byCode.missing_linked_tasks).toBe(2);
expect(payload.summary.combined).toEqual({ total: 5, errors: 3, warnings: 2 });
expect(payload.findings).toHaveLength(1);
expect(payload.findings[0]?.kind).toBe("task_flow");
expect(payload.findings[0]?.code).toBe("stale_running");
expect(payload.findings[0]?.token).toBe(runningFlow.flowId);
expect(payload.findings).toStrictEqual([
expect.objectContaining({
kind: "task_flow",
code: "stale_running",
token: runningFlow.flowId,
}),
]);
});
});
});