Skip to content

The agent that grows with you

test(desktop): isolate warm-cache mapping describe from prior gateway mock traffic

Teknium682a34a7c61b
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
index 32b6b910dc7..978e4854e2b 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
+++ b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
@@ -1982,6 +1982,14 @@ describe('resumeSession drops a redundant tile when the session loads into main'
const clientState = (storedSessionId: string | null): ClientSessionState => createClientSessionState(storedSessionId)
describe('resumeSession warm-cache mapping integrity', () => {
+ beforeEach(() => {
+ // Earlier describes (branchStoredSession) drive resumes through the
+ // profile path on the SAME hoisted mock; drop their recorded calls so the
+ // not-called assertions below only see this describe's traffic.
+ vi.mocked(requestGatewayForProfile).mockReset()
+ vi.mocked(requestGatewayForAgent).mockReset()
+ })
+
afterEach(() => {
cleanup()
setActiveSessionId(null)