File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ class GetAllLhcFillsUseCase {
7373 // Include 00:00:00 = 0 = null AND everything above 00:00:00 which is more or less than 0.
7474 queryBuilder . whereAssociation ( 'statistics' , 'runsCoverage' ) . applyOperator ( runDuration . operator , 0 ) ;
7575 queryBuilder . whereAssociation ( 'statistics' , 'runsCoverage' ) . applyOperator ( '=' , null ) ;
76+ } else if ( ( runDuration . operator === '>' || runDuration . operator === '<' ) && Number ( runDuration . limit ) === 0 ) {
77+ queryBuilder . whereAssociation ( 'statistics' , 'runsCoverage' ) . applyOperator ( runDuration . operator , 0 ) ;
7678 } else if ( Number ( runDuration . limit ) === 0 ) {
7779 queryBuilder . whereAssociation ( 'statistics' , 'runsCoverage' ) . applyOperator ( runDuration . operator , null ) ;
7880 } else {
Original file line number Diff line number Diff line change @@ -453,6 +453,56 @@ module.exports = () => {
453453 } ) ;
454454 } ) ;
455455
456+ it ( 'should return 200 and an LHCFill array for runs duration filter, = 00:00:00' , ( done ) => {
457+ request ( server )
458+ . get ( '/api/lhcFills?page[offset]=0&page[limit]=15&filter[runDuration][operator]==&filter[runDuration][limit]=00:00:00' )
459+ . expect ( 200 )
460+ . end ( ( err , res ) => {
461+ if ( err ) {
462+ done ( err ) ;
463+ return ;
464+ }
465+
466+ expect ( res . body . data ) . to . have . lengthOf ( 4 ) ;
467+ expect ( res . body . data [ 0 ] . fillNumber ) . to . equal ( 5 ) ;
468+
469+ done ( ) ;
470+ } ) ;
471+ } ) ;
472+
473+ it ( 'should return 200 and an LHCFill array for runs duration filter, > 00:00:00' , ( done ) => {
474+ request ( server )
475+ . get ( '/api/lhcFills?page[offset]=0&page[limit]=15&filter[runDuration][operator]=>&filter[runDuration][limit]=00:00:00' )
476+ . expect ( 200 )
477+ . end ( ( err , res ) => {
478+ if ( err ) {
479+ done ( err ) ;
480+ return ;
481+ }
482+
483+ expect ( res . body . data ) . to . have . lengthOf ( 1 ) ;
484+ expect ( res . body . data [ 0 ] . fillNumber ) . to . equal ( 6 ) ;
485+
486+ done ( ) ;
487+ } ) ;
488+ } ) ;
489+
490+ it ( 'should return 200 and an LHCFill array for runs duration filter, < 00:00:00' , ( done ) => {
491+ request ( server )
492+ . get ( '/api/lhcFills?page[offset]=0&page[limit]=15&filter[runDuration][operator]=<&filter[runDuration][limit]=00:00:00' )
493+ . expect ( 200 )
494+ . end ( ( err , res ) => {
495+ if ( err ) {
496+ done ( err ) ;
497+ return ;
498+ }
499+
500+ expect ( res . body . data ) . to . have . lengthOf ( 0 ) ;
501+
502+ done ( ) ;
503+ } ) ;
504+ } ) ;
505+
456506 it ( 'should return 200 and an LHCFill array for runs duration filter, > 03:00:00' , ( done ) => {
457507 request ( server )
458508 . get ( '/api/lhcFills?page[offset]=0&page[limit]=15&filter[runDuration][operator]=>&filter[runDuration][limit]=03:00:00' )
You can’t perform that action at this time.
0 commit comments