@@ -19,7 +19,7 @@ import nock from 'nock';
1919
2020import { baseUrl , getMockConfig } from '../../testUtils' ;
2121import { TransactionAsyncApi } from './transactionAsyncApi' ;
22- import { TransactionAsyncState } from './types' ;
22+ import { TransactionAsyncState , TransactionListOptions } from './types' ;
2323
2424const path = '/transactions' ;
2525
@@ -280,23 +280,41 @@ describe('TransactionAsyncApi', () => {
280280
281281 scope . done ( ) ;
282282
283- expect ( result ) . toEqual ( mockTransactions ) ;
283+ expect ( result ) . toEqual ( response ) ;
284284 } ) ;
285285
286286 it ( 'should list transactions with params' , async ( ) => {
287287 const response = {
288288 transactions : mockTransactions ,
289+ next : 'nextToken' ,
289290 } ;
291+ const date = new Date ( ) ;
292+ const options : TransactionListOptions = {
293+ engine_name : 'test_engine' ,
294+ tags : [ 'tag1' , 'tag2' ] ,
295+ 'created_on.lt' : date ,
296+ 'duration.gt' : 1000 ,
297+ sortBy : {
298+ field : 'created_on' ,
299+ order : 'desc' ,
300+ } ,
301+ next : 'nextToken' ,
302+ } ;
303+
290304 const query = {
291305 engine_name : 'test_engine' ,
292306 tags : [ 'tag1' , 'tag2' ] ,
307+ 'created_on.lt' : date . getTime ( ) ,
308+ 'duration.gt' : 1000 ,
309+ $sortby : '-created_on' ,
310+ next : 'nextToken' ,
293311 } ;
294312 const scope = nock ( baseUrl ) . get ( path ) . query ( query ) . reply ( 200 , response ) ;
295- const result = await api . listTransactions ( query ) ;
313+ const result = await api . listTransactions ( options ) ;
296314
297315 scope . done ( ) ;
298316
299- expect ( result ) . toEqual ( mockTransactions ) ;
317+ expect ( result ) . toEqual ( response ) ;
300318 } ) ;
301319
302320 it ( 'should get transaction' , async ( ) => {
0 commit comments