@@ -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,7 @@ 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 , { 456 : 'exp1' , 123 : 'exp2' } ) ;
460
490
// Force selectors to re-evaluate with a change in store.
461
491
store . refreshState ( ) ;
462
492
@@ -480,13 +510,15 @@ describe('runs_effects', () => {
480
510
newRuns : {
481
511
456 : { runs : createBarRuns ( ) } ,
482
512
} ,
513
+ expNameByExpId : { 456 : 'exp1' , 123 : 'exp2' }
483
514
} ) ,
484
515
actions . fetchRunsSucceeded ( {
485
516
experimentIds : [ '123' ] ,
486
517
runsForAllExperiments : createFooRuns ( ) ,
487
518
newRuns : {
488
519
123 : { runs : createFooRuns ( ) } ,
489
520
} ,
521
+ expNameByExpId : { 456 : 'exp1' , 123 : 'exp2' }
490
522
} ) ,
491
523
] ) ;
492
524
} ) ;
@@ -552,6 +584,7 @@ describe('runs_effects', () => {
552
584
} ) ;
553
585
554
586
store . overrideSelector ( getExperimentIdsFromRoute , [ 'foo' ] ) ;
587
+ store . overrideSelector ( getDashboardExperimentNames , { foo : 'exp1' , bar : 'exp2' } ) ;
555
588
selectSpy
556
589
. withArgs ( getRuns , { experimentId : 'foo' } )
557
590
. and . returnValue ( runsSubject ) ;
@@ -611,6 +644,7 @@ describe('runs_effects', () => {
611
644
runs : createFooAfterRuns ( ) ,
612
645
} ,
613
646
} ,
647
+ expNameByExpId : { foo : 'exp1' , bar : 'exp2' }
614
648
} ) ,
615
649
actions . fetchRunsSucceeded ( {
616
650
experimentIds : [ 'foo' , 'bar' ] ,
@@ -623,6 +657,7 @@ describe('runs_effects', () => {
623
657
runs : createBarRuns ( ) ,
624
658
} ,
625
659
} ,
660
+ expNameByExpId : { foo : 'exp1' , bar : 'exp2' }
626
661
} ) ,
627
662
] ) ;
628
663
} ) ;
0 commit comments