diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts index f993daf58d..af62f2e490 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts @@ -22,7 +22,7 @@ describe("useCopilotUIStore", () => { isNotificationsEnabled: false, isSoundEnabled: true, showNotificationDialog: false, - copilotMode: "extended_thinking", + copilotChatMode: "extended_thinking", }); }); @@ -154,35 +154,35 @@ describe("useCopilotUIStore", () => { }); }); - describe("copilotMode", () => { + describe("copilotChatMode", () => { it("defaults to extended_thinking", () => { - expect(useCopilotUIStore.getState().copilotMode).toBe( + expect(useCopilotUIStore.getState().copilotChatMode).toBe( "extended_thinking", ); }); it("sets mode to fast", () => { - useCopilotUIStore.getState().setCopilotMode("fast"); - expect(useCopilotUIStore.getState().copilotMode).toBe("fast"); + useCopilotUIStore.getState().setCopilotChatMode("fast"); + expect(useCopilotUIStore.getState().copilotChatMode).toBe("fast"); }); it("sets mode back to extended_thinking", () => { - useCopilotUIStore.getState().setCopilotMode("fast"); - useCopilotUIStore.getState().setCopilotMode("extended_thinking"); - expect(useCopilotUIStore.getState().copilotMode).toBe( + useCopilotUIStore.getState().setCopilotChatMode("fast"); + useCopilotUIStore.getState().setCopilotChatMode("extended_thinking"); + expect(useCopilotUIStore.getState().copilotChatMode).toBe( "extended_thinking", ); }); it("does not persist mode to localStorage", () => { - useCopilotUIStore.getState().setCopilotMode("fast"); + useCopilotUIStore.getState().setCopilotChatMode("fast"); expect(window.localStorage.getItem("copilot-mode")).toBeNull(); }); }); describe("clearCopilotLocalData", () => { it("resets state and clears localStorage keys", () => { - useCopilotUIStore.getState().setCopilotMode("fast"); + useCopilotUIStore.getState().setCopilotChatMode("fast"); useCopilotUIStore.getState().setNotificationsEnabled(true); useCopilotUIStore.getState().toggleSound(); useCopilotUIStore.getState().addCompletedSession("s1"); @@ -190,7 +190,7 @@ describe("useCopilotUIStore", () => { useCopilotUIStore.getState().clearCopilotLocalData(); const state = useCopilotUIStore.getState(); - expect(state.copilotMode).toBe("extended_thinking"); + expect(state.copilotChatMode).toBe("extended_thinking"); expect(state.isNotificationsEnabled).toBe(false); expect(state.isSoundEnabled).toBe(true); expect(state.completedSessionIDs.size).toBe(0); diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx index ee92b7cc94..44bdb55af5 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx @@ -8,14 +8,16 @@ import { afterEach, describe, expect, it, vi } from "vitest"; import { ChatInput } from "../ChatInput"; let mockCopilotMode = "extended_thinking"; -const mockSetCopilotMode = vi.fn((mode: string) => { +const mockSetCopilotChatMode = vi.fn((mode: string) => { mockCopilotMode = mode; }); vi.mock("@/app/(platform)/copilot/store", () => ({ useCopilotUIStore: () => ({ - copilotMode: mockCopilotMode, - setCopilotMode: mockSetCopilotMode, + copilotChatMode: mockCopilotMode, + setCopilotChatMode: mockSetCopilotChatMode, + copilotLlmModel: "standard", + setCopilotLlmModel: vi.fn(), initialPrompt: null, setInitialPrompt: vi.fn(), }), @@ -141,7 +143,7 @@ describe("ChatInput mode toggle", () => { mockCopilotMode = "extended_thinking"; render(); fireEvent.click(screen.getByLabelText(/switch to fast mode/i)); - expect(mockSetCopilotMode).toHaveBeenCalledWith("fast"); + expect(mockSetCopilotChatMode).toHaveBeenCalledWith("fast"); }); it("toggles from fast to extended_thinking on click", () => { @@ -149,7 +151,7 @@ describe("ChatInput mode toggle", () => { mockCopilotMode = "fast"; render(); fireEvent.click(screen.getByLabelText(/switch to extended thinking/i)); - expect(mockSetCopilotMode).toHaveBeenCalledWith("extended_thinking"); + expect(mockSetCopilotChatMode).toHaveBeenCalledWith("extended_thinking"); }); it("hides toggle button when streaming", () => {