@@ -1832,9 +1832,17 @@ describe('Test Plotly.react + interactions under uirevision:', function() {
18321832 } ) ;
18331833 }
18341834
1835- // mocking panning/scrolling is brittle,
1835+ // mocking panning/scrolling with mouse events is brittle,
18361836 // this here is enough to to trigger the relayoutCallback
18371837 function _mouseup ( ) {
1838+ var sceneLayout = gd . _fullLayout . scene ;
1839+ var cameraOld = sceneLayout . camera ;
1840+ sceneLayout . _scene . setCamera ( {
1841+ eye : { x : 2 , y : 2 , z : 2 } ,
1842+ center : cameraOld . center ,
1843+ up : cameraOld . up
1844+ } ) ;
1845+
18381846 var target = gd . querySelector ( '.svg-container .gl-container #scene canvas' ) ;
18391847 return new Promise ( function ( resolve ) {
18401848 mouseEvent ( 'mouseup' , 200 , 200 , { element : target } ) ;
@@ -1844,6 +1852,18 @@ describe('Test Plotly.react + interactions under uirevision:', function() {
18441852
18451853 // should be same before & after 2nd react()
18461854 function _assertGUI ( msg ) {
1855+ var TOL = 2 ;
1856+
1857+ var eye = ( ( gd . layout . scene || { } ) . camera || { } ) . eye || { } ;
1858+ expect ( eye . x ) . toBeCloseTo ( 2 , TOL , msg ) ;
1859+ expect ( eye . y ) . toBeCloseTo ( 2 , TOL , msg ) ;
1860+ expect ( eye . z ) . toBeCloseTo ( 2 , TOL , msg ) ;
1861+
1862+ var fullEye = gd . _fullLayout . scene . camera . eye ;
1863+ expect ( fullEye . x ) . toBeCloseTo ( 2 , TOL , msg ) ;
1864+ expect ( fullEye . y ) . toBeCloseTo ( 2 , TOL , msg ) ;
1865+ expect ( fullEye . z ) . toBeCloseTo ( 2 , TOL , msg ) ;
1866+
18471867 var preGUI = gd . _fullLayout . _preGUI ;
18481868 expect ( preGUI [ 'scene.camera' ] ) . toBe ( null , msg ) ;
18491869 }
0 commit comments