diff --git a/gui/src/pages/gui/chat-tests/Chat.test.tsx b/gui/src/pages/gui/chat-tests/Chat.test.tsx index b0164a437..638d3538a 100644 --- a/gui/src/pages/gui/chat-tests/Chat.test.tsx +++ b/gui/src/pages/gui/chat-tests/Chat.test.tsx @@ -15,7 +15,7 @@ test("should render input box", async () => { test("should be able to toggle modes", async () => { await renderWithProviders(); - await getElementByText("Chat"); + await getElementByText("Agent"); // Simulate cmd+. keyboard shortcut to toggle modes act(() => { @@ -27,6 +27,18 @@ test("should be able to toggle modes", async () => { ); }); + // Check that it switched to Chat mode + await getElementByText("Chat"); + + act(() => { + document.dispatchEvent( + new KeyboardEvent("keydown", { + key: ".", + metaKey: true, // cmd key on Mac + }), + ); + }); + // Check that it switched to Plan mode await getElementByText("Plan"); @@ -39,19 +51,7 @@ test("should be able to toggle modes", async () => { ); }); - // Check that it switched to Agent mode await getElementByText("Agent"); - - act(() => { - document.dispatchEvent( - new KeyboardEvent("keydown", { - key: ".", - metaKey: true, // cmd key on Mac - }), - ); - }); - - await getElementByText("Chat"); }); test("should send a message and receive a response", async () => { diff --git a/gui/src/redux/slices/sessionSlice.ts b/gui/src/redux/slices/sessionSlice.ts index 8d1ef3e3e..dbf019a22 100644 --- a/gui/src/redux/slices/sessionSlice.ts +++ b/gui/src/redux/slices/sessionSlice.ts @@ -74,7 +74,7 @@ const initialState: SessionState = { id: uuidv4(), streamAborter: new AbortController(), symbols: {}, - mode: "chat", + mode: "agent", isInEdit: false, codeBlockApplyStates: { states: [],