feat(FN-4619): add regression test for initial loading thinking state in Pl
Adds a regression test for initial loading thinking in the Planning Mode Modal and includes a changeset documenting the new behavior as a minor feature. Fusion-Task-Id: FN-4619
This commit is contained in:
5
.changeset/fn-4619-planning-initial-thinking.md
Normal file
5
.changeset/fn-4619-planning-initial-thinking.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@runfusion/fusion": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix Planning Mode so the loading view can show streamed thinking output during the initial question turn, including buffered SSE thinking events that arrive before the first question event.
|
||||||
@@ -550,6 +550,42 @@ describe("PlanningModeModal", () => {
|
|||||||
}, undefined);
|
}, undefined);
|
||||||
}, { timeout: 2000 });
|
}, { timeout: 2000 });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("shows streamed thinking in loading view before first question arrives", async () => {
|
||||||
|
mockConnectPlanningStream.mockImplementation((_sessionId: string, _projectId: string | undefined, handlers: any) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
handlers.onThinking?.("Analyzing requirements...");
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
return {
|
||||||
|
close: vi.fn(),
|
||||||
|
isConnected: vi.fn().mockReturnValue(true),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
render(
|
||||||
|
<PlanningModeModal
|
||||||
|
isOpen={true}
|
||||||
|
onClose={mockOnClose}
|
||||||
|
onTaskCreated={mockOnTaskCreated}
|
||||||
|
onTasksCreated={vi.fn()}
|
||||||
|
tasks={mockTasks}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
fireEvent.change(screen.getByPlaceholderText(/e.g., Build a user authentication/), {
|
||||||
|
target: { value: "Draft a migration plan" },
|
||||||
|
});
|
||||||
|
fireEvent.click(screen.getByText("Start Planning"));
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
|
expect(screen.getByText("AI is thinking...")).toBeDefined();
|
||||||
|
expect(screen.getByText("Analyzing requirements...")).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(screen.getByRole("button", { name: "Hide thinking" })).toBeDefined();
|
||||||
|
expect(document.querySelector(".planning-thinking-output")).not.toBeNull();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("modal height constraint regression", () => {
|
describe("modal height constraint regression", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user