feat(workflow-bar): processing-only elapsed timer + optimistic phase paint on resume
Timer now accumulates only while the harness works, pausing while a gate awaits the reviewer and freezing when finalized (keyed per session, in-memory). Resume now colours the re-entry phase immediately from the manifest's phase (1..8), mirroring the F1 paint for new questions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,20 @@ test("Resume from the panel activates the session and closes the panel", async (
|
||||
await waitFor(() => expect(screen.queryByText("Domanda originale")).not.toBeInTheDocument()); // panel closed
|
||||
});
|
||||
|
||||
test("Resume paints the re-entry phase from the manifest (optimistic, before the first gate)", async () => {
|
||||
useSessionStore.getState().resetSession();
|
||||
server.use(
|
||||
http.post("http://localhost:8787/sessions/:id/resume", () => new HttpResponse(null, { status: 204 })),
|
||||
http.get("http://localhost:8787/sessions/:id", () =>
|
||||
HttpResponse.json({ id: "s1", status: "open", phase: 4 })),
|
||||
);
|
||||
wrap();
|
||||
await userEvent.click(await screen.findByText("Attiva uno"));
|
||||
await screen.findByText("Domanda originale"); // panel open
|
||||
await userEvent.click(screen.getByRole("button", { name: /resume/i }));
|
||||
await waitFor(() => expect(useSessionStore.getState().currentPhase).toBe("F4"));
|
||||
});
|
||||
|
||||
test("a failed resume keeps the panel open and does not activate the session", async () => {
|
||||
server.use(http.post("http://localhost:8787/sessions/:id/resume", () => new HttpResponse(null, { status: 409 })));
|
||||
wrap();
|
||||
|
||||
Reference in New Issue
Block a user