feat(FN-2006): split quick chat flows into agent and model modes
- Add explicit agent/model mode toggles to QuickChatFAB and NewChatDialog - Update session target logic so model mode starts chats with the KB agent while agent mode uses selected agents - Clear opposite selections when switching modes and adjust placeholders/disabled states to match active mode - Expand ChatView and QuickChatFAB tests to cover toggle visibility, mode switching, and session payload behavior - Add useQuickChat coverage to verify agent-only switchSession calls omit model parameters
This commit is contained in:
@@ -60,6 +60,25 @@ describe("useQuickChat", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("switchSession with only agentId creates session without model params", async () => {
|
||||
const { result } = renderHook(() => useQuickChat("proj-123"));
|
||||
|
||||
await act(async () => {
|
||||
await result.current.switchSession("agent-001");
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockCreateChatSession).toHaveBeenCalledWith(
|
||||
{ agentId: "agent-001" },
|
||||
"proj-123",
|
||||
);
|
||||
// Ensure model params are not included
|
||||
const callArg = mockCreateChatSession.mock.calls[0][0];
|
||||
expect(callArg).not.toHaveProperty("modelProvider");
|
||||
expect(callArg).not.toHaveProperty("modelId");
|
||||
});
|
||||
});
|
||||
|
||||
it("switchSession falls back to KB agent when no explicit agent is provided", async () => {
|
||||
const { result } = renderHook(() => useQuickChat("proj-123"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user