File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1017,6 +1017,35 @@ describe('Test click interactions:', function() {
10171017 } )
10181018 . then ( done , done . fail ) ;
10191019 } ) ;
1020+
1021+ it ( 'when set to \'reset+autorange\' (the default) should autosize on 1st and 2nd double clicks (case of partial ranges)' , function ( done ) {
1022+ mockCopy = setRanges ( mockCopy ) ;
1023+
1024+ Plotly . newPlot ( gd , [ {
1025+ y : [ 1 , 2 , 3 , 4 ] }
1026+ ] , {
1027+ xaxis : { range : [ 1 , null ] } ,
1028+ yaxis : { range : [ null , 3 ] } ,
1029+ width : 600 ,
1030+ height : 600
1031+ } ) . then ( function ( ) {
1032+ expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 1 , 3.2 ] ) ;
1033+ expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 0.8 , 3 ] ) ;
1034+
1035+ return doubleClick ( 300 , 300 ) ;
1036+ } )
1037+ . then ( function ( ) {
1038+ expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ - 0.2 , 3.2 ] ) ;
1039+ expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 0.8 , 4.2 ] ) ;
1040+
1041+ return doubleClick ( 300 , 300 ) ;
1042+ } )
1043+ . then ( function ( ) {
1044+ expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 1 , 3.2 ] ) ;
1045+ expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( [ 0.8 , 3 ] ) ;
1046+ } )
1047+ . then ( done , done . fail ) ;
1048+ } ) ;
10201049 } ) ;
10211050
10221051 describe ( 'zoom interactions' , function ( ) {
You can’t perform that action at this time.
0 commit comments