@@ -54,6 +54,7 @@ import {DiscreteFilter, IntervalFilter} from '../../../hparams/types';
54
54
import {
55
55
getCurrentRouteRunSelection ,
56
56
getEnabledColorGroup ,
57
+ getEnabledColorGroupByRegex ,
57
58
getExperiment ,
58
59
getExperimentIdToAliasMap ,
59
60
getRouteId ,
@@ -249,6 +250,7 @@ describe('runs_table', () => {
249
250
) ;
250
251
store . overrideSelector ( getRouteId , '123' ) ;
251
252
store . overrideSelector ( getEnabledColorGroup , false ) ;
253
+ store . overrideSelector ( getEnabledColorGroupByRegex , false ) ;
252
254
store . overrideSelector ( getRunGroupBy , { key : GroupByKey . RUN } ) ;
253
255
dispatchSpy = spyOn ( store , 'dispatch' ) . and . callFake ( ( action : Action ) => {
254
256
actualActions . push ( action ) ;
@@ -559,9 +561,9 @@ describe('runs_table', () => {
559
561
expect ( menuButton ) . toBeTruthy ( ) ;
560
562
} ) ;
561
563
562
- /* TODO(japie1235813): Brings back group by regex. */
563
- it ( 'renders "Experiment" and "Run"' , ( ) => {
564
+ it ( 'renders "Experiment", "Run", and "Regex"' , ( ) => {
564
565
store . overrideSelector ( getEnabledColorGroup , true ) ;
566
+ store . overrideSelector ( getEnabledColorGroupByRegex , true ) ;
565
567
const fixture = createComponent (
566
568
[ 'book' ] ,
567
569
[ RunsTableColumn . RUN_NAME , RunsTableColumn . RUN_COLOR ]
@@ -577,14 +579,15 @@ describe('runs_table', () => {
577
579
578
580
expect (
579
581
items . map ( ( element ) => element . querySelector ( 'label' ) ! . textContent )
580
- ) . toEqual ( [ 'Experiment' , 'Run' ] ) ;
582
+ ) . toEqual ( [ 'Experiment' , 'Run' , 'Regex' ] ) ;
581
583
} ) ;
582
584
583
585
it (
584
586
'renders a check icon and aria-checked for the current groupBy menu ' +
585
587
'item' ,
586
588
( ) => {
587
589
store . overrideSelector ( getEnabledColorGroup , true ) ;
590
+ store . overrideSelector ( getEnabledColorGroupByRegex , true ) ;
588
591
store . overrideSelector ( getRunGroupBy , { key : GroupByKey . EXPERIMENT } ) ;
589
592
const fixture = createComponent (
590
593
[ 'book' ] ,
@@ -599,15 +602,13 @@ describe('runs_table', () => {
599
602
600
603
const items = getOverlayMenuItems ( ) ;
601
604
602
- /* TODO(japie1235813): Brings back group by regex. */
603
605
expect (
604
606
items . map ( ( element ) => element . getAttribute ( 'aria-checked' ) )
605
- ) . toEqual ( [ 'true' , 'false' ] ) ;
607
+ ) . toEqual ( [ 'true' , 'false' , 'false' ] ) ;
606
608
expect (
607
609
items . map ( ( element ) => Boolean ( element . querySelector ( 'mat-icon' ) ) )
608
- ) . toEqual ( [ true , false ] ) ;
610
+ ) . toEqual ( [ true , false , false ] ) ;
609
611
610
- /* TODO(japie1235813): Brings back group by regex.
611
612
store . overrideSelector ( getRunGroupBy , {
612
613
key : GroupByKey . REGEX ,
613
614
regexString : 'hello' ,
@@ -621,12 +622,12 @@ describe('runs_table', () => {
621
622
expect (
622
623
items . map ( ( element ) => Boolean ( element . querySelector ( 'mat-icon' ) ) )
623
624
) . toEqual ( [ false , false , true ] ) ;
624
- */
625
625
}
626
626
) ;
627
627
628
628
it ( 'dispatches `runGroupByChanged` when a menu item is clicked' , ( ) => {
629
629
store . overrideSelector ( getEnabledColorGroup , true ) ;
630
+ store . overrideSelector ( getEnabledColorGroupByRegex , true ) ;
630
631
store . overrideSelector ( getRunGroupBy , { key : GroupByKey . EXPERIMENT } ) ;
631
632
const fixture = createComponent (
632
633
[ 'book' ] ,
@@ -641,7 +642,7 @@ describe('runs_table', () => {
641
642
642
643
const items = getOverlayMenuItems ( ) ;
643
644
644
- const [ experiments , runs ] = items as HTMLElement [ ] ;
645
+ const [ experiments , runs , regex ] = items as HTMLElement [ ] ;
645
646
experiments . click ( ) ;
646
647
647
648
expect ( dispatchSpy ) . toHaveBeenCalledWith (
@@ -659,17 +660,15 @@ describe('runs_table', () => {
659
660
} )
660
661
) ;
661
662
662
- /* TODO(japie1235813): Brings back group by regex.
663
663
regex . click ( ) ;
664
664
expect ( dispatchSpy ) . toHaveBeenCalledWith (
665
665
runGroupByChanged ( {
666
666
experimentIds : [ 'book' ] ,
667
- // regexString is hardcoded to '' for now; should be fixed when
668
- // regex support is properly implemented.
667
+ // TODO(japie1235813): regexString is hardcoded to '' for now;
668
+ // should be fixed when regex support is properly implemented.
669
669
groupBy : { key : GroupByKey . REGEX , regexString : '' } ,
670
670
} )
671
671
) ;
672
- */
673
672
} ) ;
674
673
675
674
it (
0 commit comments