@@ -1832,9 +1832,17 @@ describe('Test Plotly.react + interactions under uirevision:', function() {
1832
1832
} ) ;
1833
1833
}
1834
1834
1835
- // mocking panning/scrolling is brittle,
1835
+ // mocking panning/scrolling with mouse events is brittle,
1836
1836
// this here is enough to to trigger the relayoutCallback
1837
1837
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
+
1838
1846
var target = gd . querySelector ( '.svg-container .gl-container #scene canvas' ) ;
1839
1847
return new Promise ( function ( resolve ) {
1840
1848
mouseEvent ( 'mouseup' , 200 , 200 , { element : target } ) ;
@@ -1844,6 +1852,18 @@ describe('Test Plotly.react + interactions under uirevision:', function() {
1844
1852
1845
1853
// should be same before & after 2nd react()
1846
1854
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
+
1847
1867
var preGUI = gd . _fullLayout . _preGUI ;
1848
1868
expect ( preGUI [ 'scene.camera' ] ) . toBe ( null , msg ) ;
1849
1869
}
0 commit comments