Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(test): update Conversations render test to match new UI layout

Steven Enamakel289b6b7d2d4e
diff --git a/app/src/pages/__tests__/Conversations.render.test.tsx b/app/src/pages/__tests__/Conversations.render.test.tsx
index 2cfa317af5..9ee7eccd9b 100644
--- a/app/src/pages/__tests__/Conversations.render.test.tsx
+++ b/app/src/pages/__tests__/Conversations.render.test.tsx
@@ -72,6 +72,16 @@ vi.mock('../../services/chatService', () => ({
useRustChat: vi.fn(() => true),
}));
+const { mockGetClientConfig, mockUpdateRuntimeSettings } = vi.hoisted(() => ({
+ mockGetClientConfig: vi.fn(),
+ mockUpdateRuntimeSettings: vi.fn(),
+}));
+vi.mock('../../utils/tauriCommands/config', async importOriginal => ({
+ ...(await importOriginal<typeof import('../../utils/tauriCommands/config')>()),
+ openhumanGetClientConfig: mockGetClientConfig,
+ openhumanUpdateRuntimeSettings: mockUpdateRuntimeSettings,
+}));
+
vi.mock('../../services/api/threadApi', () => ({
threadApi: {
createNewThread: vi.fn().mockResolvedValue({ id: 'new-thread', labels: [] }),
@@ -818,6 +828,27 @@ describe('Conversations — smoke render (#1123 welcome-lock removal)', () => {
expect(chatSend).not.toHaveBeenCalled();
});
+ it('loads the thinking level from config, persists a new pick and sends it', async () => {
+ mockGetClientConfig.mockResolvedValue({ result: { reasoning_effort: 'low' } });
+ const { textarea, thread } = await renderSelectedConversation();
+
+ const picker = (await screen.findByTestId('composer-reasoning-effort')) as HTMLSelectElement;
+ await waitFor(() => expect(picker.value).toBe('low'));
+
+ fireEvent.change(picker, { target: { value: 'high' } });
+ expect(mockUpdateRuntimeSettings).toHaveBeenCalledWith({ reasoning_effort: 'high' });
+
+ await submitComposerText(textarea, 'think hard');
+ await waitFor(() => {
+ expect(chatSend).toHaveBeenCalledWith(
+ expect.objectContaining({ threadId: thread.id, reasoningEffort: 'high' })
+ );
+ });
+
+ fireEvent.change(picker, { target: { value: 'default' } });
+ expect(mockUpdateRuntimeSettings).toHaveBeenLastCalledWith({ reasoning_effort: '' });
+ });
+
it('persists a local user message and sends through chat service for valid input', async () => {
const { textarea, thread } = await renderSelectedConversation();