@@ -71,6 +71,10 @@ describe('ResultFilter', () => {
7171
7272 beforeEach ( ( ) => {
7373 jest . clearAllMocks ( ) ;
74+ if ( HttpClient . get . mock ) {
75+ HttpClient . get . mockResolvedValue ( { ok : true , json : ( ) => [ ] } ) ;
76+ HttpClient . handleResponse . mockResolvedValue ( [ ] ) ;
77+ }
7478 } ) ;
7579
7680 describe ( 'Rendering' , ( ) => {
@@ -251,7 +255,9 @@ describe('ResultFilter', () => {
251255 it ( 'should pass hideFilters prop to ActiveFilters' , ( ) => {
252256 renderComponent ( { hideFilters : [ 'project_id' ] } ) ;
253257
254- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
258+ expect (
259+ screen . getByTestId ( 'filter-table-apply-button' ) ,
260+ ) . toBeInTheDocument ( ) ;
255261 } ) ;
256262 } ) ;
257263
@@ -326,7 +332,9 @@ describe('ResultFilter', () => {
326332 } ,
327333 ) ;
328334
329- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
335+ expect (
336+ screen . getByTestId ( 'filter-table-apply-button' ) ,
337+ ) . toBeInTheDocument ( ) ;
330338 } ) ;
331339
332340 it ( 'should filter runs based on input' , ( ) => {
@@ -350,12 +358,16 @@ describe('ResultFilter', () => {
350358 fieldSelection : 'run_id' ,
351359 } }
352360 >
353- < ResultFilter runs = { [ 'run-abc-123' , 'run-def-456' , 'run-abc-789' ] } />
361+ < ResultFilter
362+ runs = { [ 'run-abc-123' , 'run-def-456' , 'run-abc-789' ] }
363+ />
354364 </ FilterContext . Provider >
355365 </ MemoryRouter > ,
356366 ) ;
357367
358- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
368+ expect (
369+ screen . getByTestId ( 'filter-table-apply-button' ) ,
370+ ) . toBeInTheDocument ( ) ;
359371 } ) ;
360372
361373 it ( 'should render run multi-select for multi operation mode' , ( ) => {
@@ -368,7 +380,9 @@ describe('ResultFilter', () => {
368380 } ,
369381 ) ;
370382
371- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
383+ expect (
384+ screen . getByTestId ( 'filter-table-apply-button' ) ,
385+ ) . toBeInTheDocument ( ) ;
372386 } ) ;
373387 } ) ;
374388
@@ -398,7 +412,9 @@ describe('ResultFilter', () => {
398412 } ,
399413 ) ;
400414
401- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
415+ expect (
416+ screen . getByTestId ( 'filter-table-apply-button' ) ,
417+ ) . toBeInTheDocument ( ) ;
402418 } ) ;
403419 } ) ;
404420
@@ -457,25 +473,33 @@ describe('ResultFilter', () => {
457473 it ( 'should accept maxHeight prop' , ( ) => {
458474 renderComponent ( { maxHeight : '400px' } ) ;
459475
460- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
476+ expect (
477+ screen . getByTestId ( 'filter-table-apply-button' ) ,
478+ ) . toBeInTheDocument ( ) ;
461479 } ) ;
462480
463481 it ( 'should use default maxHeight when not provided' , ( ) => {
464482 renderComponent ( ) ;
465483
466- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
484+ expect (
485+ screen . getByTestId ( 'filter-table-apply-button' ) ,
486+ ) . toBeInTheDocument ( ) ;
467487 } ) ;
468488
469489 it ( 'should accept runs prop' , ( ) => {
470490 renderComponent ( { runs : [ 'run-1' , 'run-2' , 'run-3' ] } ) ;
471491
472- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
492+ expect (
493+ screen . getByTestId ( 'filter-table-apply-button' ) ,
494+ ) . toBeInTheDocument ( ) ;
473495 } ) ;
474496
475497 it ( 'should handle empty runs array' , ( ) => {
476498 renderComponent ( { runs : [ ] } ) ;
477499
478- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
500+ expect (
501+ screen . getByTestId ( 'filter-table-apply-button' ) ,
502+ ) . toBeInTheDocument ( ) ;
479503 } ) ;
480504 } ) ;
481505
@@ -533,7 +557,9 @@ describe('ResultFilter', () => {
533557 } ,
534558 ) ;
535559
536- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
560+ expect (
561+ screen . getByTestId ( 'filter-table-apply-button' ) ,
562+ ) . toBeInTheDocument ( ) ;
537563 } ) ;
538564 } ) ;
539565
@@ -565,7 +591,9 @@ describe('ResultFilter', () => {
565591 ) ;
566592
567593 // Component should render with context
568- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
594+ expect (
595+ screen . getByTestId ( 'filter-table-apply-button' ) ,
596+ ) . toBeInTheDocument ( ) ;
569597 } ) ;
570598 } ) ;
571599
@@ -592,7 +620,9 @@ describe('ResultFilter', () => {
592620 } ,
593621 ) ;
594622
595- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
623+ expect (
624+ screen . getByTestId ( 'filter-table-apply-button' ) ,
625+ ) . toBeInTheDocument ( ) ;
596626 } ) ;
597627
598628 it ( 'should handle run selection in multi mode' , ( ) => {
@@ -605,7 +635,9 @@ describe('ResultFilter', () => {
605635 } ,
606636 ) ;
607637
608- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
638+ expect (
639+ screen . getByTestId ( 'filter-table-apply-button' ) ,
640+ ) . toBeInTheDocument ( ) ;
609641 } ) ;
610642
611643 it ( 'should handle empty run input' , ( ) => {
@@ -618,7 +650,9 @@ describe('ResultFilter', () => {
618650 } ,
619651 ) ;
620652
621- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
653+ expect (
654+ screen . getByTestId ( 'filter-table-apply-button' ) ,
655+ ) . toBeInTheDocument ( ) ;
622656 } ) ;
623657 } ) ;
624658
@@ -633,7 +667,9 @@ describe('ResultFilter', () => {
633667 } ,
634668 ) ;
635669
636- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
670+ expect (
671+ screen . getByTestId ( 'filter-table-apply-button' ) ,
672+ ) . toBeInTheDocument ( ) ;
637673 } ) ;
638674
639675 it ( 'should handle result selection in multi mode' , ( ) => {
@@ -646,7 +682,9 @@ describe('ResultFilter', () => {
646682 } ,
647683 ) ;
648684
649- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
685+ expect (
686+ screen . getByTestId ( 'filter-table-apply-button' ) ,
687+ ) . toBeInTheDocument ( ) ;
650688 } ) ;
651689 } ) ;
652690
@@ -747,7 +785,9 @@ describe('ResultFilter', () => {
747785 } ,
748786 ) ;
749787
750- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
788+ expect (
789+ screen . getByTestId ( 'filter-table-apply-button' ) ,
790+ ) . toBeInTheDocument ( ) ;
751791 } ) ;
752792
753793 it ( 'should handle value options in multi mode' , ( ) => {
@@ -760,7 +800,9 @@ describe('ResultFilter', () => {
760800 } ,
761801 ) ;
762802
763- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
803+ expect (
804+ screen . getByTestId ( 'filter-table-apply-button' ) ,
805+ ) . toBeInTheDocument ( ) ;
764806 } ) ;
765807 } ) ;
766808
@@ -776,7 +818,9 @@ describe('ResultFilter', () => {
776818 ) ;
777819
778820 // All toggles should be available through context
779- expect ( screen . getByTestId ( 'filter-table-apply-button' ) ) . toBeInTheDocument ( ) ;
821+ expect (
822+ screen . getByTestId ( 'filter-table-apply-button' ) ,
823+ ) . toBeInTheDocument ( ) ;
780824 } ) ;
781825 } ) ;
782826
@@ -845,7 +889,7 @@ describe('ResultFilter', () => {
845889 fieldSelection : 'metadata.browser' ,
846890 filterMode : 'text' ,
847891 operationMode : 'single' ,
848- }
892+ } ,
849893 ) ;
850894
851895 await waitFor ( ( ) => {
@@ -854,7 +898,9 @@ describe('ResultFilter', () => {
854898 } ) ;
855899
856900 it ( 'should fetch with days=90 parameter' , async ( ) => {
857- HttpClient . get . mockReturnValue ( Promise . resolve ( { ok : true , json : ( ) => [ ] } ) ) ;
901+ HttpClient . get . mockReturnValue (
902+ Promise . resolve ( { ok : true , json : ( ) => [ ] } ) ,
903+ ) ;
858904 HttpClient . handleResponse . mockReturnValue ( [ ] ) ;
859905
860906 renderComponent (
@@ -863,13 +909,13 @@ describe('ResultFilter', () => {
863909 fieldSelection : 'metadata.browser' ,
864910 filterMode : 'text' ,
865911 operationMode : 'single' ,
866- }
912+ } ,
867913 ) ;
868914
869915 await waitFor ( ( ) => {
870916 expect ( HttpClient . get ) . toHaveBeenCalledWith (
871917 expect . anything ( ) ,
872- expect . objectContaining ( { days : 90 } )
918+ expect . objectContaining ( { days : 90 } ) ,
873919 ) ;
874920 } ) ;
875921 } ) ;
0 commit comments