@@ -179,7 +179,7 @@ describe('getBulkOperationStatus', () => {
179179 expect ( output . info ( ) ) . toContain ( 'Bulk operation canceled.' )
180180 } )
181181
182- test ( 'calls resolveApiVersion with minimum API version' , async ( ) => {
182+ test ( 'calls resolveApiVersion with minimum API version constant ' , async ( ) => {
183183 vi . mocked ( adminRequestDoc ) . mockResolvedValue ( mockBulkOperation ( { status : 'RUNNING' } ) )
184184
185185 await getBulkOperationStatus ( { organization : mockOrganization , storeFqdn, operationId, remoteApp} )
@@ -191,6 +191,19 @@ describe('getBulkOperationStatus', () => {
191191 )
192192 } )
193193
194+ test ( 'uses resolved API version in admin request' , async ( ) => {
195+ vi . mocked ( resolveApiVersion ) . mockResolvedValue ( 'test-api-version' )
196+ vi . mocked ( adminRequestDoc ) . mockResolvedValue ( mockBulkOperation ( { status : 'RUNNING' } ) )
197+
198+ await getBulkOperationStatus ( { organization : mockOrganization , storeFqdn, operationId, remoteApp} )
199+
200+ expect ( adminRequestDoc ) . toHaveBeenCalledWith (
201+ expect . objectContaining ( {
202+ version : 'test-api-version' ,
203+ } ) ,
204+ )
205+ } )
206+
194207 describe ( 'time formatting' , ( ) => {
195208 test ( 'uses "Started" for running operations' , async ( ) => {
196209 vi . mocked ( adminRequestDoc ) . mockResolvedValue ( mockBulkOperation ( { status : 'RUNNING' } ) )
@@ -351,7 +364,7 @@ describe('listBulkOperations', () => {
351364 expect ( output . info ( ) ) . toContain ( 'No bulk operations found in the last 7 days.' )
352365 } )
353366
354- test ( 'calls resolveApiVersion with minimum API version' , async ( ) => {
367+ test ( 'calls resolveApiVersion with minimum API version constant ' , async ( ) => {
355368 vi . mocked ( adminRequestDoc ) . mockResolvedValue ( mockBulkOperationsList ( [ ] ) )
356369
357370 await listBulkOperations ( { organization : mockOrganization , storeFqdn, remoteApp} )
@@ -362,4 +375,17 @@ describe('listBulkOperations', () => {
362375 BULK_OPERATIONS_MIN_API_VERSION ,
363376 )
364377 } )
378+
379+ test ( 'uses resolved API version in admin request' , async ( ) => {
380+ vi . mocked ( resolveApiVersion ) . mockResolvedValue ( 'test-api-version' )
381+ vi . mocked ( adminRequestDoc ) . mockResolvedValue ( mockBulkOperationsList ( [ ] ) )
382+
383+ await listBulkOperations ( { organization : mockOrganization , storeFqdn, remoteApp} )
384+
385+ expect ( adminRequestDoc ) . toHaveBeenCalledWith (
386+ expect . objectContaining ( {
387+ version : 'test-api-version' ,
388+ } ) ,
389+ )
390+ } )
365391} )
0 commit comments