@@ -29,6 +29,7 @@ import * as coreActions from '../../core/actions';
29
29
import * as hparamsActions from '../../hparams/_redux/hparams_actions' ;
30
30
import {
31
31
getActiveRoute ,
32
+ getDashboardExperimentNames ,
32
33
getExperimentIdsFromRoute ,
33
34
getRuns ,
34
35
getRunsLoadState ,
@@ -131,6 +132,10 @@ describe('runs_effects', () => {
131
132
buildCompareRoute ( [ 'exp1:123' , 'exp2:456' ] )
132
133
) ;
133
134
store . overrideSelector ( getExperimentIdsFromRoute , [ '123' , '456' ] ) ;
135
+ store . overrideSelector ( getDashboardExperimentNames , {
136
+ 456 : 'exp2' ,
137
+ 123 : 'exp1' ,
138
+ } ) ;
134
139
const createFooRuns = ( ) => [
135
140
createRun ( {
136
141
id : 'foo/runA' ,
@@ -166,6 +171,10 @@ describe('runs_effects', () => {
166
171
runs : createFooRuns ( ) ,
167
172
} ,
168
173
} ,
174
+ expNameByExpId : {
175
+ 456 : 'exp2' ,
176
+ 123 : 'exp1' ,
177
+ } ,
169
178
} ) ,
170
179
] ) ;
171
180
} ) ;
@@ -211,6 +220,10 @@ describe('runs_effects', () => {
211
220
buildCompareRoute ( [ 'exp1:123' , ' exp2:456' ] )
212
221
) ;
213
222
store . overrideSelector ( getExperimentIdsFromRoute , [ '123' , '456' ] ) ;
223
+ store . overrideSelector ( getDashboardExperimentNames , {
224
+ 456 : 'exp2' ,
225
+ 123 : 'exp1' ,
226
+ } ) ;
214
227
store . refreshState ( ) ;
215
228
216
229
action . next ( specAction ( ) ) ;
@@ -244,6 +257,10 @@ describe('runs_effects', () => {
244
257
runs : createBarRuns ( ) ,
245
258
} ,
246
259
} ,
260
+ expNameByExpId : {
261
+ 456 : 'exp2' ,
262
+ 123 : 'exp1' ,
263
+ } ,
247
264
} ) ,
248
265
] ) ;
249
266
} ) ;
@@ -310,6 +327,10 @@ describe('runs_effects', () => {
310
327
buildCompareRoute ( [ 'exp1:123' , ' exp2:456' ] )
311
328
) ;
312
329
store . overrideSelector ( getExperimentIdsFromRoute , [ '123' , '456' ] ) ;
330
+ store . overrideSelector ( getDashboardExperimentNames , {
331
+ 456 : 'exp1' ,
332
+ 123 : 'exp2' ,
333
+ } ) ;
313
334
store . refreshState ( ) ;
314
335
315
336
action . next ( buildNavigatedAction ( ) ) ;
@@ -328,13 +349,18 @@ describe('runs_effects', () => {
328
349
runs : createBarRuns ( ) ,
329
350
} ,
330
351
} ,
352
+ expNameByExpId : {
353
+ 456 : 'exp1' ,
354
+ 123 : 'exp2' ,
355
+ } ,
331
356
} ) ,
332
357
] ) ;
333
358
} ) ;
334
359
335
360
it ( 'ignores a navigation to same route and experiments (hash changes)' , ( ) => {
336
361
store . overrideSelector ( getActiveRoute , buildRoute ( ) ) ;
337
362
store . overrideSelector ( getExperimentIdsFromRoute , [ '123' ] ) ;
363
+ store . overrideSelector ( getDashboardExperimentNames , { 123 : 'exp1' } ) ;
338
364
const createFooRuns = ( ) => [
339
365
createRun ( {
340
366
id : 'foo/runA' ,
@@ -363,6 +389,7 @@ describe('runs_effects', () => {
363
389
experimentIds : [ '123' ] ,
364
390
runsForAllExperiments : [ ...createFooRuns ( ) ] ,
365
391
newRuns : { } ,
392
+ expNameByExpId : { 123 : 'exp1' } ,
366
393
} ) ,
367
394
] ) ;
368
395
@@ -391,6 +418,7 @@ describe('runs_effects', () => {
391
418
} )
392
419
) ;
393
420
store . overrideSelector ( getExperimentIdsFromRoute , [ 'foo' ] ) ;
421
+ store . overrideSelector ( getDashboardExperimentNames , { foo : 'exp1' } ) ;
394
422
store . refreshState ( ) ;
395
423
396
424
action . next ( buildNavigatedAction ( ) ) ;
@@ -404,6 +432,7 @@ describe('runs_effects', () => {
404
432
experimentIds : [ 'foo' ] ,
405
433
runsForAllExperiments : [ ...createFooRuns ( ) ] ,
406
434
newRuns : { } ,
435
+ expNameByExpId : { foo : 'exp1' } ,
407
436
} ) ,
408
437
] ) ;
409
438
} ) ;
@@ -457,6 +486,10 @@ describe('runs_effects', () => {
457
486
// Emulate navigation to a new experiment route.
458
487
store . overrideSelector ( getActiveRoute , buildExperimentRouteFromId ( '456' ) ) ;
459
488
store . overrideSelector ( getExperimentIdsFromRoute , [ '456' ] ) ;
489
+ store . overrideSelector ( getDashboardExperimentNames , {
490
+ 456 : 'exp1' ,
491
+ 123 : 'exp2' ,
492
+ } ) ;
460
493
// Force selectors to re-evaluate with a change in store.
461
494
store . refreshState ( ) ;
462
495
@@ -480,13 +513,15 @@ describe('runs_effects', () => {
480
513
newRuns : {
481
514
456 : { runs : createBarRuns ( ) } ,
482
515
} ,
516
+ expNameByExpId : { 456 : 'exp1' , 123 : 'exp2' } ,
483
517
} ) ,
484
518
actions . fetchRunsSucceeded ( {
485
519
experimentIds : [ '123' ] ,
486
520
runsForAllExperiments : createFooRuns ( ) ,
487
521
newRuns : {
488
522
123 : { runs : createFooRuns ( ) } ,
489
523
} ,
524
+ expNameByExpId : { 456 : 'exp1' , 123 : 'exp2' } ,
490
525
} ) ,
491
526
] ) ;
492
527
} ) ;
@@ -552,6 +587,10 @@ describe('runs_effects', () => {
552
587
} ) ;
553
588
554
589
store . overrideSelector ( getExperimentIdsFromRoute , [ 'foo' ] ) ;
590
+ store . overrideSelector ( getDashboardExperimentNames , {
591
+ foo : 'exp1' ,
592
+ bar : 'exp2' ,
593
+ } ) ;
555
594
selectSpy
556
595
. withArgs ( getRuns , { experimentId : 'foo' } )
557
596
. and . returnValue ( runsSubject ) ;
@@ -611,6 +650,7 @@ describe('runs_effects', () => {
611
650
runs : createFooAfterRuns ( ) ,
612
651
} ,
613
652
} ,
653
+ expNameByExpId : { foo : 'exp1' , bar : 'exp2' } ,
614
654
} ) ,
615
655
actions . fetchRunsSucceeded ( {
616
656
experimentIds : [ 'foo' , 'bar' ] ,
@@ -623,6 +663,7 @@ describe('runs_effects', () => {
623
663
runs : createBarRuns ( ) ,
624
664
} ,
625
665
} ,
666
+ expNameByExpId : { foo : 'exp1' , bar : 'exp2' } ,
626
667
} ) ,
627
668
] ) ;
628
669
} ) ;
0 commit comments