@@ -174,13 +174,13 @@ describe('operations/mrt/push', () => {
174174 ) ;
175175
176176 const auth = new MockAuthStrategy ( ) ;
177- const client = createMrtClient ( { } , auth ) ;
178177
179- const bundles = await listBundles ( client , 'my-project' ) ;
178+ const result = await listBundles ( { projectSlug : 'my-project' } , auth ) ;
180179
181- expect ( bundles ) . to . have . length ( 2 ) ;
182- expect ( bundles [ 0 ] ) . to . deep . include ( { id : 123 , message : 'Bundle 1' } ) ;
183- expect ( bundles [ 1 ] ) . to . deep . include ( { id : 124 , message : 'Bundle 2' } ) ;
180+ expect ( result . bundles ) . to . have . length ( 2 ) ;
181+ expect ( result . bundles [ 0 ] ) . to . deep . include ( { id : 123 , message : 'Bundle 1' } ) ;
182+ expect ( result . bundles [ 1 ] ) . to . deep . include ( { id : 124 , message : 'Bundle 2' } ) ;
183+ expect ( result . count ) . to . equal ( 2 ) ;
184184 } ) ;
185185
186186 it ( 'passes pagination options' , async ( ) => {
@@ -189,14 +189,13 @@ describe('operations/mrt/push', () => {
189189 server . use (
190190 http . get ( `${ DEFAULT_BASE_URL } /api/projects/:projectSlug/bundles/` , ( { request} ) => {
191191 queryParams = new URL ( request . url ) . searchParams ;
192- return HttpResponse . json ( { results : [ ] } ) ;
192+ return HttpResponse . json ( { count : 0 , results : [ ] } ) ;
193193 } ) ,
194194 ) ;
195195
196196 const auth = new MockAuthStrategy ( ) ;
197- const client = createMrtClient ( { } , auth ) ;
198197
199- await listBundles ( client , 'my-project' , { limit : 10 , offset : 20 } ) ;
198+ await listBundles ( { projectSlug : 'my-project' , limit : 10 , offset : 20 } , auth ) ;
200199
201200 expect ( queryParams ?. get ( 'limit' ) ) . to . equal ( '10' ) ;
202201 expect ( queryParams ?. get ( 'offset' ) ) . to . equal ( '20' ) ;
@@ -213,11 +212,11 @@ describe('operations/mrt/push', () => {
213212 ) ;
214213
215214 const auth = new MockAuthStrategy ( ) ;
216- const client = createMrtClient ( { } , auth ) ;
217215
218- const bundles = await listBundles ( client , 'my-project' ) ;
216+ const result = await listBundles ( { projectSlug : 'my-project' } , auth ) ;
219217
220- expect ( bundles ) . to . have . length ( 0 ) ;
218+ expect ( result . bundles ) . to . have . length ( 0 ) ;
219+ expect ( result . count ) . to . equal ( 0 ) ;
221220 } ) ;
222221
223222 it ( 'throws error on API failure' , async ( ) => {
@@ -228,10 +227,9 @@ describe('operations/mrt/push', () => {
228227 ) ;
229228
230229 const auth = new MockAuthStrategy ( ) ;
231- const client = createMrtClient ( { } , auth ) ;
232230
233231 try {
234- await listBundles ( client , 'my-project' ) ;
232+ await listBundles ( { projectSlug : 'my-project' } , auth ) ;
235233 expect . fail ( 'Should have thrown' ) ;
236234 } catch ( error ) {
237235 expect ( ( error as Error ) . message ) . to . include ( 'Failed to list bundles' ) ;
0 commit comments