feat(workflow-bar): optimistic F1 at start; all-green when session finalized

This commit is contained in:
2026-07-03 13:22:09 +02:00
parent 37b3eb45e9
commit e630ac98f9
5 changed files with 33 additions and 10 deletions
+14
View File
@@ -36,3 +36,17 @@ test("the active dot turns to the error state when phaseError flags it", () => {
render(<WorkflowBar />);
expect(screen.getByTestId("phase-F3")).toHaveAttribute("data-state", "error");
});
test("currentPhase F1 renders F1 as running (yellow)", () => {
useSessionStore.getState().setPhase("F1");
render(<WorkflowBar />);
expect(screen.getByTestId("phase-F1")).toHaveAttribute("data-state", "running");
});
test("finalized marks all phases done (green)", () => {
useSessionStore.getState().setPhase("F8");
render(<WorkflowBar finalized />);
for (const id of ["F1", "F4", "F8"]) {
expect(screen.getByTestId(`phase-${id}`)).toHaveAttribute("data-state", "done");
}
});