Skip to content

The agent that grows with you

test(desktop): reset the leaked getLatestSessionMessages mock in the submitToSession suite

Brooklyn Nicholson3daf72a6b9ac
diff --git a/apps/desktop/src/app/contrib/hooks/use-session-tile-delegate.test.ts b/apps/desktop/src/app/contrib/hooks/use-session-tile-delegate.test.ts
index 5da326cb42a..a5cb68ff0c8 100644
--- a/apps/desktop/src/app/contrib/hooks/use-session-tile-delegate.test.ts
+++ b/apps/desktop/src/app/contrib/hooks/use-session-tile-delegate.test.ts
@@ -762,6 +762,12 @@ describe('useSessionTileDelegate stale multi-window guard (#65047)', () => {
describe('useSessionTileDelegate submitToSession', () => {
beforeEach(() => {
setSessions([])
+ // A leftover mockResolvedValueOnce on getLatestSessionMessages from an
+ // earlier describe leaks into this suite's full-file run, so reset the
+ // mock and restore its default empty-transcript implementation (same
+ // pattern as the #65047 describe above).
+ vi.mocked(getLatestSessionMessages).mockReset()
+ vi.mocked(getLatestSessionMessages).mockImplementation(async () => ({ messages: [], session_id: '' }))
})
afterEach(() => {