@@ -27,8 +27,6 @@ vi.mock('@/lib/terminal/transport', () => ({
2727import type { MothershipEffort } from '@/lib/mothership/model-options'
2828import {
2929 fetchMothershipChatHistory ,
30- mothershipChatHistoryQueryOptions ,
31- useDeleteMothershipChat ,
3230 useDeleteMothershipChats ,
3331 useSetMothershipChatEffort ,
3432} from '@/hooks/queries/mothership-chats'
@@ -103,46 +101,6 @@ describe('tasks query boundary parsing', () => {
103101 } )
104102 } )
105103
106- it ( 'reads a deleted chat no more while a view holds it, and forgets it once the view leaves' , async ( ) => {
107- const tanstack =
108- await vi . importActual < typeof import ( '@tanstack/react-query' ) > ( '@tanstack/react-query' )
109- const client = new tanstack . QueryClient ( )
110- reactQueryMockFns . mockUseQueryClient . mockReturnValueOnce (
111- client as unknown as typeof queryClient
112- )
113- const mutation = useDeleteMothershipChat ( { organizationId : 'org-1' } ) as unknown as {
114- onSuccess : ( data : undefined , chatId : string ) => Promise < void >
115- }
116- const options = mothershipChatHistoryQueryOptions ( 'chat-open' )
117- vi . mocked ( fetch ) . mockResolvedValueOnce (
118- jsonResponse ( {
119- success : true ,
120- chat : {
121- id : 'chat-open' ,
122- title : null ,
123- mode : 'assistant' ,
124- messages : [ ] ,
125- activeStreamId : null ,
126- resources : [ ] ,
127- } ,
128- } )
129- )
130- await client . prefetchQuery ( options )
131- vi . mocked ( fetch ) . mockClear ( )
132- const view = new tanstack . QueryObserver ( client , options )
133- const leave = view . subscribe ( ( ) => { } )
134-
135- await mutation . onSuccess ( undefined , 'chat-open' )
136- view . getOptimisticResult ( client . defaultQueryOptions ( options ) )
137- view . setOptions ( options )
138-
139- expect ( fetch ) . not . toHaveBeenCalled ( )
140- expect ( view . getCurrentResult ( ) . isSuccess ) . toBe ( true )
141- leave ( )
142- expect ( client . getQueryCache ( ) . find ( { queryKey : options . queryKey } ) ) . toBeUndefined ( )
143- client . clear ( )
144- } )
145-
146104 it ( 'loads a chat from a server that predates the effort field' , async ( ) => {
147105 vi . mocked ( fetch ) . mockResolvedValueOnce (
148106 jsonResponse ( {
0 commit comments