@@ -29,6 +29,7 @@ import * as coreActions from '../../core/actions';
2929import * as hparamsActions from '../../hparams/_redux/hparams_actions' ;
3030import {
3131 getActiveRoute ,
32+ getDashboardExperimentNames ,
3233 getExperimentIdsFromRoute ,
3334 getRuns ,
3435 getRunsLoadState ,
@@ -131,6 +132,10 @@ describe('runs_effects', () => {
131132 buildCompareRoute ( [ 'exp1:123' , 'exp2:456' ] )
132133 ) ;
133134 store . overrideSelector ( getExperimentIdsFromRoute , [ '123' , '456' ] ) ;
135+ store . overrideSelector ( getDashboardExperimentNames , {
136+ 456 : 'exp2' ,
137+ 123 : 'exp1'
138+ } ) ;
134139 const createFooRuns = ( ) => [
135140 createRun ( {
136141 id : 'foo/runA' ,
@@ -166,6 +171,10 @@ describe('runs_effects', () => {
166171 runs : createFooRuns ( ) ,
167172 } ,
168173 } ,
174+ expNameByExpId : {
175+ 456 : 'exp2' ,
176+ 123 : 'exp1'
177+ }
169178 } ) ,
170179 ] ) ;
171180 } ) ;
@@ -211,6 +220,10 @@ describe('runs_effects', () => {
211220 buildCompareRoute ( [ 'exp1:123' , ' exp2:456' ] )
212221 ) ;
213222 store . overrideSelector ( getExperimentIdsFromRoute , [ '123' , '456' ] ) ;
223+ store . overrideSelector ( getDashboardExperimentNames , {
224+ 456 : 'exp2' ,
225+ 123 : 'exp1'
226+ } ) ;
214227 store . refreshState ( ) ;
215228
216229 action . next ( specAction ( ) ) ;
@@ -244,6 +257,10 @@ describe('runs_effects', () => {
244257 runs : createBarRuns ( ) ,
245258 } ,
246259 } ,
260+ expNameByExpId : {
261+ 456 : 'exp2' ,
262+ 123 : 'exp1'
263+ }
247264 } ) ,
248265 ] ) ;
249266 } ) ;
@@ -310,6 +327,10 @@ describe('runs_effects', () => {
310327 buildCompareRoute ( [ 'exp1:123' , ' exp2:456' ] )
311328 ) ;
312329 store . overrideSelector ( getExperimentIdsFromRoute , [ '123' , '456' ] ) ;
330+ store . overrideSelector ( getDashboardExperimentNames , {
331+ 456 : 'exp1' ,
332+ 123 : 'exp2'
333+ } ) ;
313334 store . refreshState ( ) ;
314335
315336 action . next ( buildNavigatedAction ( ) ) ;
@@ -328,13 +349,18 @@ describe('runs_effects', () => {
328349 runs : createBarRuns ( ) ,
329350 } ,
330351 } ,
352+ expNameByExpId : {
353+ 456 : 'exp1' ,
354+ 123 : 'exp2'
355+ }
331356 } ) ,
332357 ] ) ;
333358 } ) ;
334359
335360 it ( 'ignores a navigation to same route and experiments (hash changes)' , ( ) => {
336361 store . overrideSelector ( getActiveRoute , buildRoute ( ) ) ;
337362 store . overrideSelector ( getExperimentIdsFromRoute , [ '123' ] ) ;
363+ store . overrideSelector ( getDashboardExperimentNames , { 123 : 'exp1' } ) ;
338364 const createFooRuns = ( ) => [
339365 createRun ( {
340366 id : 'foo/runA' ,
@@ -363,6 +389,7 @@ describe('runs_effects', () => {
363389 experimentIds : [ '123' ] ,
364390 runsForAllExperiments : [ ...createFooRuns ( ) ] ,
365391 newRuns : { } ,
392+ expNameByExpId : { 123 : 'exp1' }
366393 } ) ,
367394 ] ) ;
368395
@@ -391,6 +418,7 @@ describe('runs_effects', () => {
391418 } )
392419 ) ;
393420 store . overrideSelector ( getExperimentIdsFromRoute , [ 'foo' ] ) ;
421+ store . overrideSelector ( getDashboardExperimentNames , { foo : 'exp1' } ) ;
394422 store . refreshState ( ) ;
395423
396424 action . next ( buildNavigatedAction ( ) ) ;
@@ -404,6 +432,7 @@ describe('runs_effects', () => {
404432 experimentIds : [ 'foo' ] ,
405433 runsForAllExperiments : [ ...createFooRuns ( ) ] ,
406434 newRuns : { } ,
435+ expNameByExpId : { foo : 'exp1' }
407436 } ) ,
408437 ] ) ;
409438 } ) ;
@@ -457,6 +486,7 @@ describe('runs_effects', () => {
457486 // Emulate navigation to a new experiment route.
458487 store . overrideSelector ( getActiveRoute , buildExperimentRouteFromId ( '456' ) ) ;
459488 store . overrideSelector ( getExperimentIdsFromRoute , [ '456' ] ) ;
489+ store . overrideSelector ( getDashboardExperimentNames , { 456 : 'exp1' , 123 : 'exp2' } ) ;
460490 // Force selectors to re-evaluate with a change in store.
461491 store . refreshState ( ) ;
462492
@@ -480,13 +510,15 @@ describe('runs_effects', () => {
480510 newRuns : {
481511 456 : { runs : createBarRuns ( ) } ,
482512 } ,
513+ expNameByExpId : { 456 : 'exp1' , 123 : 'exp2' }
483514 } ) ,
484515 actions . fetchRunsSucceeded ( {
485516 experimentIds : [ '123' ] ,
486517 runsForAllExperiments : createFooRuns ( ) ,
487518 newRuns : {
488519 123 : { runs : createFooRuns ( ) } ,
489520 } ,
521+ expNameByExpId : { 456 : 'exp1' , 123 : 'exp2' }
490522 } ) ,
491523 ] ) ;
492524 } ) ;
@@ -552,6 +584,7 @@ describe('runs_effects', () => {
552584 } ) ;
553585
554586 store . overrideSelector ( getExperimentIdsFromRoute , [ 'foo' ] ) ;
587+ store . overrideSelector ( getDashboardExperimentNames , { foo : 'exp1' , bar : 'exp2' } ) ;
555588 selectSpy
556589 . withArgs ( getRuns , { experimentId : 'foo' } )
557590 . and . returnValue ( runsSubject ) ;
@@ -611,6 +644,7 @@ describe('runs_effects', () => {
611644 runs : createFooAfterRuns ( ) ,
612645 } ,
613646 } ,
647+ expNameByExpId : { foo : 'exp1' , bar : 'exp2' }
614648 } ) ,
615649 actions . fetchRunsSucceeded ( {
616650 experimentIds : [ 'foo' , 'bar' ] ,
@@ -623,6 +657,7 @@ describe('runs_effects', () => {
623657 runs : createBarRuns ( ) ,
624658 } ,
625659 } ,
660+ expNameByExpId : { foo : 'exp1' , bar : 'exp2' }
626661 } ) ,
627662 ] ) ;
628663 } ) ;
0 commit comments