@@ -575,6 +575,78 @@ module.exports = () => {
575575 expect ( runs ) . to . have . lengthOf ( 0 ) ;
576576 } ) ;
577577
578+ it ( 'should successfully filter on ctf file count number' , async ( ) => {
579+ const ctfFileCount = {
580+ operator : '<' ,
581+ limit : 200 ,
582+ } ;
583+ getAllRunsDto . query = { filter : { ctfFileCount } } ;
584+
585+ let { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ;
586+ expect ( runs ) . to . be . an ( 'array' ) ;
587+ expect ( runs ) . to . have . lengthOf ( 1 ) ;
588+
589+ ctfFileCount . operator = '<=' ;
590+ ( { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ) ;
591+ expect ( runs ) . to . be . an ( 'array' ) ;
592+ expect ( runs ) . to . have . lengthOf ( 2 ) ;
593+ expect ( runs . every ( ( run ) => run . ctfFileCount <= 200 ) ) . to . be . true ;
594+
595+ ctfFileCount . operator = '=' ;
596+ ( { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ) ;
597+ expect ( runs ) . to . be . an ( 'array' ) ;
598+ expect ( runs ) . to . have . lengthOf ( 1 ) ;
599+ expect ( runs . every ( ( run ) => run . ctfFileCount === 200 ) ) . to . be . true ;
600+
601+ ctfFileCount . operator = '>=' ;
602+ ( { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ) ;
603+ expect ( runs ) . to . be . an ( 'array' ) ;
604+ expect ( runs ) . to . have . lengthOf ( 7 ) ;
605+ expect ( runs . every ( ( run ) => run . ctfFileCount >= 200 ) ) . to . be . true ;
606+
607+ ctfFileCount . operator = '>' ;
608+ ( { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ) ;
609+ expect ( runs ) . to . be . an ( 'array' ) ;
610+ expect ( runs ) . to . have . lengthOf ( 6 ) ;
611+ expect ( runs . every ( ( run ) => run . ctfFileCount >= 500 ) ) . to . be . true ;
612+ } ) ;
613+
614+ it ( 'should successfully filter on tf file count number' , async ( ) => {
615+ const tfFileCount = {
616+ operator : '<' ,
617+ limit : 30 ,
618+ } ;
619+ getAllRunsDto . query = { filter : { tfFileCount } } ;
620+
621+ let { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ;
622+ expect ( runs ) . to . be . an ( 'array' ) ;
623+ expect ( runs ) . to . have . lengthOf ( 0 ) ;
624+
625+ tfFileCount . operator = '<=' ;
626+ ( { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ) ;
627+ expect ( runs ) . to . be . an ( 'array' ) ;
628+ expect ( runs ) . to . have . lengthOf ( 7 ) ;
629+ expect ( runs . every ( ( run ) => run . tfFileCount <= 30 ) ) . to . be . true ;
630+
631+ tfFileCount . operator = '=' ;
632+ ( { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ) ;
633+ expect ( runs ) . to . be . an ( 'array' ) ;
634+ expect ( runs ) . to . have . lengthOf ( 7 ) ;
635+ expect ( runs . every ( ( run ) => run . tfFileCount === 30 ) ) . to . be . true ;
636+
637+ tfFileCount . operator = '>=' ;
638+ ( { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ) ;
639+ expect ( runs ) . to . be . an ( 'array' ) ;
640+ expect ( runs ) . to . have . lengthOf ( 8 ) ;
641+ expect ( runs . every ( ( run ) => run . tfFileCount >= 30 ) ) . to . be . true ;
642+
643+ tfFileCount . operator = '>' ;
644+ ( { runs } = await new GetAllRunsUseCase ( ) . execute ( getAllRunsDto ) ) ;
645+ expect ( runs ) . to . be . an ( 'array' ) ;
646+ expect ( runs ) . to . have . lengthOf ( 1 ) ;
647+ expect ( runs . every ( ( run ) => run . tfFileCount > 30 ) ) . to . be . true ;
648+ } ) ;
649+
578650 it ( 'should successfully return an array, only containing runs found from passed list' , async ( ) => {
579651 getAllRunsDto . query = {
580652 filter : {
0 commit comments