@@ -55,12 +55,31 @@ describe("Transfers", (): void => {
55
55
} ) ;
56
56
57
57
test ( "should list transactions" , async ( ) : Promise < void > => {
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" ) ) ;
58
+ const createdSince = new Date ( Date . UTC ( 2023 , 11 , 12 , 0 , 0 , 0 ) ) ; // 12-12-2023 December is month 11
59
+ const createdUntil = new Date ( Date . UTC ( 2023 , 11 , 13 , 0 , 0 , 0 ) ) ; // 13-12-2023 December is month 11
60
+
61
+ scope
62
+ . get ( "/transactions" )
63
+ . query ( {
64
+ balancePlatform : "platform" ,
65
+ createdSince : createdSince . toISOString ( ) ,
66
+ createdUntil : createdUntil . toISOString ( ) ,
67
+ } )
68
+ . reply ( 200 , listTransactionsSuccess ) ;
69
+
70
+ const response : transfers . TransactionSearchResponse = await transfersAPI . TransactionsApi . getAllTransactions (
71
+ "platform" ,
72
+ undefined ,
73
+ undefined ,
74
+ undefined ,
75
+ undefined ,
76
+ createdSince ,
77
+ createdUntil
78
+ ) ;
79
+
61
80
expect ( response . data ?. length ) . toEqual ( 3 ) ;
62
- if ( response . data && response . data ? .length > 0 ) {
63
- expect ( response ? .data [ 0 ] ? .id ) . toEqual ( "1VVF0D5U66PIUIVP" ) ;
81
+ if ( response . data && response . data . length > 0 ) {
82
+ expect ( response . data [ 0 ] . id ) . toEqual ( "1VVF0D5U66PIUIVP" ) ;
64
83
} else {
65
84
fail ( ) ;
66
85
}
0 commit comments