@@ -117,6 +117,7 @@ const mockAxiosRequest = () => {
117117 }
118118 if (
119119 config . url ?. includes ( 'transactions/index' ) ||
120+ config . url ?. includes ( '/transactions/single' ) ||
120121 config . url ?. includes ( '/execute/permits' )
121122 ) {
122123 return Promise . resolve ( {
@@ -339,7 +340,7 @@ describe('Should test the executeSteps method.', () => {
339340 undefined
340341 )
341342 ) . rejects . toThrow (
342- `Deposit transaction with hash '0x' is pending after 1 attempt(s).`
343+ `Deposit transaction with hash '0x' and request id '0xabc' is pending after 1 attempt(s).`
343344 )
344345 vi . spyOn ( axios , 'request' ) . mockRestore ( )
345346 vi . spyOn ( axios , 'request' ) . mockClear ( )
@@ -432,7 +433,7 @@ describe('Should test the executeSteps method.', () => {
432433 undefined
433434 )
434435 ) . rejects . toThrow (
435- `Failed to receive a successful response for solver status check with hash '0x' after 1 attempt(s).`
436+ `Failed to receive a successful response for solver status check with hash '0x' and request id '0xabc' after 1 attempt(s).`
436437 )
437438
438439 vi . spyOn ( axios , 'request' ) . mockRestore ( )
@@ -495,6 +496,8 @@ describe('Should test the executeSteps method.', () => {
495496 it ( 'Should handle step with id of "approve" by waiting on receipt before polling for confirmation' , async ( ) => {
496497 const axiosRequestSpy = vi . spyOn ( axios , 'request' )
497498
499+ client . logLevel = 4
500+
498501 await executeSteps (
499502 1 ,
500503 { } ,
@@ -506,12 +509,12 @@ describe('Should test the executeSteps method.', () => {
506509
507510 const waitForTransactionReceiptCallIndex =
508511 wallet . handleConfirmTransactionStep . mock . invocationCallOrder [ 0 ]
509- const pollForConfirmationCallIndices = axiosRequestSpy . mock . calls
510- . filter ( ( call ) => call [ 0 ] . url ?. includes ( '/intents/status' ) )
511- . map ( ( call , index ) => axiosRequestSpy . mock . invocationCallOrder [ index ] )
512+ const pollForConfirmationCallIndex = axiosRequestSpy . mock . calls . findIndex (
513+ ( call ) => call [ 0 ] . url ?. includes ( '/intents/status' )
514+ )
512515
513516 expect ( waitForTransactionReceiptCallIndex ) . toBeLessThan (
514- Math . min ( ... pollForConfirmationCallIndices )
517+ axiosRequestSpy . mock . invocationCallOrder [ pollForConfirmationCallIndex ]
515518 )
516519 expect ( wallet . handleConfirmTransactionStep ) . toHaveBeenCalledTimes ( 2 )
517520 } )
0 commit comments