@@ -203,6 +203,19 @@ describe('getBulkOperationStatus', () => {
203203 )
204204 } )
205205
206+ test ( 'uses resolved API version in admin request' , async ( ) => {
207+ vi . mocked ( resolveApiVersion ) . mockResolvedValue ( 'test-api-version' )
208+ vi . mocked ( adminRequestDoc ) . mockResolvedValue ( mockBulkOperation ( { status : 'RUNNING' } ) )
209+
210+ await getBulkOperationStatus ( { organization : mockOrganization , storeFqdn, operationId, remoteApp} )
211+
212+ expect ( adminRequestDoc ) . toHaveBeenCalledWith (
213+ expect . objectContaining ( {
214+ version : 'test-api-version' ,
215+ } ) ,
216+ )
217+ } )
218+
206219 describe ( 'time formatting' , ( ) => {
207220 test ( 'uses "Started" for running operations' , async ( ) => {
208221 vi . mocked ( adminRequestDoc ) . mockResolvedValue ( mockBulkOperation ( { status : 'RUNNING' } ) )
@@ -386,4 +399,17 @@ describe('listBulkOperations', () => {
386399 } ) ,
387400 )
388401 } )
402+
403+ test ( 'uses resolved API version in admin request' , async ( ) => {
404+ vi . mocked ( resolveApiVersion ) . mockResolvedValue ( 'test-api-version' )
405+ vi . mocked ( adminRequestDoc ) . mockResolvedValue ( mockBulkOperationsList ( [ ] ) )
406+
407+ await listBulkOperations ( { organization : mockOrganization , storeFqdn, remoteApp} )
408+
409+ expect ( adminRequestDoc ) . toHaveBeenCalledWith (
410+ expect . objectContaining ( {
411+ version : 'test-api-version' ,
412+ } ) ,
413+ )
414+ } )
389415} )
0 commit comments