@@ -9,7 +9,6 @@ let client: Client;
9
9
let transfersAPI : TransfersAPI ;
10
10
let scope : nock . Scope ;
11
11
12
-
13
12
beforeEach ( ( ) : void => {
14
13
if ( ! nock . isActive ( ) ) {
15
14
nock . activate ( ) ;
@@ -56,34 +55,14 @@ describe("Transfers", (): void => {
56
55
} ) ;
57
56
58
57
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" ) ) ;
81
61
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" ) ;
84
64
} else {
85
65
fail ( ) ;
86
66
}
87
67
} ) ;
88
-
89
68
} ) ;
0 commit comments