@@ -350,14 +350,22 @@ describe('Test gl plot interactions', function() {
350
350
351
351
setTimeout ( function ( ) {
352
352
353
- expect ( relayoutCallback ) . toHaveBeenCalled ( ) ; // initiator: resetCameraDefault3d
353
+ expect ( relayoutCallback ) . toHaveBeenCalledTimes ( 2 ) ; // initiator: resetCameraDefault3d; 2 scenes
354
354
expect ( relayoutCallback ) . toHaveBeenCalledWith ( {
355
355
scene : {
356
356
eye : { x : 1.25 , y : 1.25 , z : 1.25 } ,
357
357
center : { x : 0 , y : 0 , z : 0 } ,
358
358
up : { x : 0 , y : 0 , z : 1 }
359
359
}
360
360
} ) ;
361
+ expect ( relayoutCallback ) . toHaveBeenCalledWith ( {
362
+ scene2 : {
363
+ center : { x : 0 , y : 0 , z : 0 } ,
364
+ eye : { x : 1.25 , y : 1.25 , z : 1.25 } ,
365
+ up : { x : 0 , y : 0 , z : 1 }
366
+ }
367
+ } ) ;
368
+ relayoutCallback . calls . reset ( ) ;
361
369
362
370
expect ( sceneLayout . camera . eye )
363
371
. toEqual ( { x : 0.1 , y : 0.1 , z : 1 } , 'does not change the layout objects' ) ;
@@ -372,14 +380,21 @@ describe('Test gl plot interactions', function() {
372
380
373
381
setTimeout ( function ( ) {
374
382
375
- expect ( relayoutCallback ) . toHaveBeenCalled ( ) ; // initiator: resetCameraLastSave3d
383
+ expect ( relayoutCallback ) . toHaveBeenCalledTimes ( 2 ) ; // initiator: resetCameraLastSave3d; 2 scenes
376
384
expect ( relayoutCallback ) . toHaveBeenCalledWith ( {
377
385
scene : {
378
- eye : { x : 1.25 , y : 1.25 , z : 1.25 } ,
379
386
center : { x : 0 , y : 0 , z : 0 } ,
387
+ eye : { x : 0.1 , y : 0.1 , z : 1 } ,
388
+ up : { x : 0 , y : 0 , z : 1 }
389
+ }
390
+ } ) ;
391
+ expect ( relayoutCallback ) . toHaveBeenCalledWith ( {
392
+ scene2 : {
393
+ center : { x : 0 , y : 0 , z : 0 } ,
394
+ eye : { x : 2.5 , y : 2.5 , z : 2.5 } ,
380
395
up : { x : 0 , y : 0 , z : 1 }
381
396
}
382
- } ) ; // looks like there's no real saved data so it reverts to default
397
+ } ) ;
383
398
384
399
expect ( sceneLayout . camera . eye )
385
400
. toEqual ( { x : 0.1 , y : 0.1 , z : 1 } , 'does not change the layout objects' ) ;
0 commit comments