Skip to content

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

fix(aui): correct thread goal test to expect goal after user message

Steven Enamakel64b668f475ae
diff --git a/app/src/features/conversations/aui/useThreadGoal.test.tsx b/app/src/features/conversations/aui/useThreadGoal.test.tsx
index dfd912b934..9f4142f0b8 100644
--- a/app/src/features/conversations/aui/useThreadGoal.test.tsx
+++ b/app/src/features/conversations/aui/useThreadGoal.test.tsx
@@ -58,13 +58,12 @@ describe('useLoadThreadGoal', () => {
});
it('leaves the slice untouched when the RPC fails', async () => {
- const rejection = Promise.reject(new Error('no such method'));
- rejection.catch(() => {}); // pre-handle so vitest doesn't flag it unhandled
- vi.mocked(threadApi.getGoal).mockReturnValue(rejection);
+ vi.mocked(threadApi.getGoal).mockImplementation(() => Promise.reject(new Error('no such method')));
const { store, wrapper } = setup();
renderHook(() => useLoadThreadGoal('t1'), { wrapper });
await waitFor(() => expect(threadApi.getGoal).toHaveBeenCalled());
+ await new Promise(resolve => setTimeout(resolve, 10));
expect(store.getState().threadGoal.byThread.t1).toBeUndefined();
});
});