@@ -2172,21 +2172,55 @@ describe('Qraft uses Operation Query Function', () => {
21722172 ) ;
21732173 } ) ;
21742174
2175- it ( 'uses Operation Query without arguments' , async ( ) => {
2176- const { qraft } = createClient ( ) ;
2175+ describe ( 'uses Operation Query without arguments' , ( ) => {
2176+ it ( 'uses Operation Query without invoke options' , async ( ) => {
2177+ const { qraft } = createClient ( ) ;
21772178
2178- const { data, error } = await qraft . files . findAll ( ) ;
2179+ const { data, error } = await qraft . files . findAll ( ) ;
21792180
2180- expect (
2181- error satisfies
2182- | Services [ 'files' ] [ 'findAll' ] [ 'types' ] [ 'error' ]
2183- | Error
2184- | undefined
2185- ) . toBeUndefined ( ) ;
2181+ expect (
2182+ error satisfies
2183+ | Services [ 'files' ] [ 'findAll' ] [ 'types' ] [ 'error' ]
2184+ | Error
2185+ | undefined
2186+ ) . toBeUndefined ( ) ;
21862187
2187- expect (
2188- data satisfies Services [ 'files' ] [ 'findAll' ] [ 'types' ] [ 'data' ] | undefined
2189- ) . toEqual ( filesFindAllResponsePayloadFixtures ) ;
2188+ expect (
2189+ data satisfies Services [ 'files' ] [ 'findAll' ] [ 'types' ] [ 'data' ] | undefined
2190+ ) . toEqual ( filesFindAllResponsePayloadFixtures ) ;
2191+ } ) ;
2192+
2193+ it ( 'uses Operation Query with `signal` without `parameters`' , async ( ) => {
2194+ const { qraft } = createClient ( ) ;
2195+
2196+ const requestFnSpy = vi . fn ( requestFn ) as typeof requestFn ;
2197+
2198+ const controller = new AbortController ( ) ;
2199+ const signal = controller . signal ;
2200+
2201+ const { data, error } = await qraft . files . findAll (
2202+ { signal } ,
2203+ requestFnSpy
2204+ ) ;
2205+
2206+ expect (
2207+ error satisfies
2208+ | Services [ 'files' ] [ 'findAll' ] [ 'types' ] [ 'error' ]
2209+ | Error
2210+ | undefined
2211+ ) . toBeUndefined ( ) ;
2212+
2213+ expect (
2214+ data satisfies Services [ 'files' ] [ 'findAll' ] [ 'types' ] [ 'data' ] | undefined
2215+ ) . toEqual ( filesFindAllResponsePayloadFixtures ) ;
2216+
2217+ expect ( requestFnSpy ) . toHaveBeenCalledWith (
2218+ qraft . files . findAll . schema ,
2219+ expect . objectContaining ( {
2220+ signal,
2221+ } )
2222+ ) ;
2223+ } ) ;
21902224 } ) ;
21912225
21922226 it ( 'uses Operation Query with `queryKey`' , async ( ) => {
0 commit comments