@@ -9,7 +9,6 @@ let client: Client;
99let transfersAPI : TransfersAPI ;
1010let scope : nock . Scope ;
1111
12-
1312beforeEach ( ( ) : void => {
1413 if ( ! nock . isActive ( ) ) {
1514 nock . activate ( ) ;
@@ -56,34 +55,14 @@ describe("Transfers", (): void => {
5655 } ) ;
5756
5857 test ( "should list transactions" , async ( ) : Promise < void > => {
59- const createdSince = new Date ( Date . UTC ( 2023 , 11 , 12 , 0 , 0 , 0 ) ) ; // 12-12-2023 December is month 11
60- const createdUntil = new Date ( Date . UTC ( 2023 , 11 , 13 , 0 , 0 , 0 ) ) ; // 13-12-2023 December is month 11
61-
62- scope
63- . get ( "/transactions" )
64- . query ( {
65- balancePlatform : "platform" ,
66- createdSince : createdSince . toISOString ( ) ,
67- createdUntil : createdUntil . toISOString ( ) ,
68- } )
69- . reply ( 200 , listTransactionsSuccess ) ;
70-
71- const response : transfers . TransactionSearchResponse = await transfersAPI . TransactionsApi . getAllTransactions (
72- "platform" ,
73- undefined ,
74- undefined ,
75- undefined ,
76- undefined ,
77- createdSince ,
78- createdUntil
79- ) ;
80-
58+ scope . get ( "/transactions?balancePlatform=platform&createdSince=2023-12-12T00%3A00%3A00.000Z&createdUntil=2023-12-13T00%3A00%3A00.000Z" )
59+ . reply ( 200 , listTransactionsSuccess ) ;
60+ const response : transfers . TransactionSearchResponse = await transfersAPI . TransactionsApi . getAllTransactions ( "platform" , undefined , undefined , undefined , undefined , new Date ( "12-12-2023" ) , new Date ( "12-13-2023" ) ) ;
8161 expect ( response . data ?. length ) . toEqual ( 3 ) ;
82- if ( response . data && response . data . length > 0 ) {
83- expect ( response . data [ 0 ] . id ) . toEqual ( "1VVF0D5U66PIUIVP" ) ;
62+ if ( response . data && response . data ? .length > 0 ) {
63+ expect ( response ? .data [ 0 ] ? .id ) . toEqual ( "1VVF0D5U66PIUIVP" ) ;
8464 } else {
8565 fail ( ) ;
8666 }
8767 } ) ;
88-
8968} ) ;
0 commit comments