Skip to content

The agent that grows with you

test(desktop): trim salvaged fixtures to the invariant tests

Tekniumd31318745cda
diff --git a/apps/desktop/src/app/contrib/hooks/use-background-sync.test.tsx b/apps/desktop/src/app/contrib/hooks/use-background-sync.test.tsx
index 91f06f1cc66..694a352fada 100644
--- a/apps/desktop/src/app/contrib/hooks/use-background-sync.test.tsx
+++ b/apps/desktop/src/app/contrib/hooks/use-background-sync.test.tsx
@@ -69,22 +69,6 @@ describe('useBackgroundSync profile-scoped session refresh', () => {
expect(request).toHaveBeenCalledTimes(2)
})
- it('discards a queued old-connection refresh when the connection changes', async () => {
- let rejectOld!: (reason: Error) => void
- const oldRequest = new Promise<{ sessions: [] }>((_, reject) => { rejectOld = reject })
- const request = vi.fn().mockReturnValueOnce(oldRequest).mockResolvedValue({ sessions: [] })
- const hook = render('default', 'first', async () => undefined, request)
- await act(async () => { $sessionsChangeTick.set(1) })
- hook.rerender({ connectionId: 'second', profile: 'default' })
- await act(async () => undefined)
- expect(request).toHaveBeenCalledTimes(2)
- await act(async () => { rejectOld(new Error('old connection closed')) })
- expect(request).toHaveBeenCalledTimes(2)
- hook.unmount()
- await act(async () => { $sessionsChangeTick.set(2) })
- expect(request).toHaveBeenCalledTimes(2)
- })
-
it('refreshes the session list after the active gateway profile changes', async () => {
const refreshSessions = vi.fn(async () => undefined)
const hook = render('default', 'local', refreshSessions)
diff --git a/apps/desktop/src/app/session/session-state-cache.test.ts b/apps/desktop/src/app/session/session-state-cache.test.ts
index e5f145d0786..c00ac5a964e 100644
--- a/apps/desktop/src/app/session/session-state-cache.test.ts
+++ b/apps/desktop/src/app/session/session-state-cache.test.ts
@@ -84,21 +84,6 @@ describe('SessionStateCache', () => {
stringify.mockRestore()
})
- it('never measures a pinned active transcript while streaming', () => {
- const cache = new SessionStateCache({ isReferenced: () => true, onEvict: () => undefined })
- const state = settled('active', 'stream')
- const stringify = vi.spyOn(JSON, 'stringify')
- try {
- for (let flush = 0; flush < 20; flush += 1) {
- cache.set('active', { ...state, messages: [...state.messages] })
- cache.prune()
- }
- expect(stringify).not.toHaveBeenCalled()
- } finally {
- stringify.mockRestore()
- }
- })
-
it('uses transcript bytes as well as count', () => {
const evicted: string[] = []