@@ -1495,11 +1495,37 @@ describe('TransactionHttp', () => {
14951495 . toPromise ( ) ;
14961496 expect ( transactions . data . length ) . to . be . greaterThan ( 0 ) ;
14971497 } ) ;
1498- it ( 'should return transaction info given height' , async ( ) => {
1498+ it ( 'should return transaction info given height all types ' , async ( ) => {
14991499 const transactions = await transactionRepository
15001500 . search ( { group : TransactionGroup . Confirmed , height : UInt64 . fromUint ( 1 ) } as TransactionSearchCriteria )
15011501 . toPromise ( ) ;
1502- expect ( transactions . data . length ) . to . be . greaterThan ( 0 ) ;
1502+
1503+ const mosaicDefinitions = transactions . data . filter ( ( t ) => t . type == TransactionType . MOSAIC_DEFINITION ) . length ;
1504+ const namespaceRegistration = transactions . data . filter ( ( t ) => t . type == TransactionType . NAMESPACE_REGISTRATION ) . length ;
1505+ const others = transactions . data . filter (
1506+ ( t ) => t . type !== TransactionType . NAMESPACE_REGISTRATION && t . type !== TransactionType . MOSAIC_DEFINITION ,
1507+ ) . length ;
1508+ expect ( mosaicDefinitions ) . to . be . greaterThan ( 0 ) ;
1509+ expect ( namespaceRegistration ) . to . be . greaterThan ( 0 ) ;
1510+ expect ( others ) . to . be . greaterThan ( 0 ) ;
1511+ } ) ;
1512+
1513+ it ( 'should return transaction info given height and namesapce, mosaic types' , async ( ) => {
1514+ const transactions = await transactionRepository
1515+ . search ( {
1516+ group : TransactionGroup . Confirmed ,
1517+ height : UInt64 . fromUint ( 1 ) ,
1518+ type : [ TransactionType . MOSAIC_DEFINITION , TransactionType . NAMESPACE_REGISTRATION ] ,
1519+ } as TransactionSearchCriteria )
1520+ . toPromise ( ) ;
1521+ const mosaicDefinitions = transactions . data . filter ( ( t ) => t . type == TransactionType . MOSAIC_DEFINITION ) . length ;
1522+ const namespaceRegistration = transactions . data . filter ( ( t ) => t . type == TransactionType . NAMESPACE_REGISTRATION ) . length ;
1523+ const others = transactions . data . filter (
1524+ ( t ) => t . type !== TransactionType . NAMESPACE_REGISTRATION && t . type !== TransactionType . MOSAIC_DEFINITION ,
1525+ ) . length ;
1526+ expect ( mosaicDefinitions ) . to . be . greaterThan ( 0 ) ;
1527+ expect ( namespaceRegistration ) . to . be . greaterThan ( 0 ) ;
1528+ expect ( others ) . to . eq ( 0 ) ;
15031529 } ) ;
15041530 } ) ;
15051531
0 commit comments