@@ -445,7 +445,7 @@ describe('the range slider', function() {
445445 it ( 'should not mutate layoutIn' , function ( ) {
446446 var layoutIn = { xaxis : { rangeslider : { visible : true } } } ,
447447 layoutOut = { xaxis : { rangeslider : { } } } ,
448- expected = { xaxis : { rangeslider : { visible : true } } } ;
448+ expected = { xaxis : { rangeslider : { visible : true } } } ;
449449
450450 _supply ( layoutIn , layoutOut , 'xaxis' ) ;
451451 expect ( layoutIn ) . toEqual ( expected ) ;
@@ -457,7 +457,6 @@ describe('the range slider', function() {
457457 expected = {
458458 visible : true ,
459459 autorange : true ,
460- range : [ - 1 , 6 ] ,
461460 thickness : 0.15 ,
462461 bgcolor : '#fff' ,
463462 borderwidth : 0 ,
@@ -475,7 +474,6 @@ describe('the range slider', function() {
475474 expected = {
476475 visible : true ,
477476 autorange : true ,
478- range : [ - 1 , 6 ] ,
479477 thickness : 0.15 ,
480478 bgcolor : '#fff' ,
481479 borderwidth : 0 ,
@@ -507,7 +505,6 @@ describe('the range slider', function() {
507505 expected = {
508506 visible : true ,
509507 autorange : true ,
510- range : [ - 1 , 6 ] ,
511508 thickness : 0.15 ,
512509 bgcolor : '#fff' ,
513510 borderwidth : 0 ,
@@ -519,34 +516,12 @@ describe('the range slider', function() {
519516 expect ( layoutOut . xaxis . rangeslider ) . toEqual ( expected ) ;
520517 } ) ;
521518
522- it ( 'should expand the rangeslider range to axis range' , function ( ) {
523- var layoutIn = { xaxis : { rangeslider : { range : [ 5 , 6 ] } } } ,
524- layoutOut = { xaxis : { range : [ 1 , 10 ] , type : 'linear' } } ,
525- expected = {
526- visible : true ,
527- autorange : false ,
528- range : [ 1 , 10 ] ,
529- thickness : 0.15 ,
530- bgcolor : '#fff' ,
531- borderwidth : 0 ,
532- bordercolor : '#444' ,
533- _input : layoutIn . xaxis . rangeslider
534- } ;
535-
536- _supply ( layoutIn , layoutOut , 'xaxis' ) ;
537-
538- // don't compare the whole layout, because we had to run setConvert which
539- // attaches all sorts of other stuff to xaxis
540- expect ( layoutOut . xaxis . rangeslider ) . toEqual ( expected ) ;
541- } ) ;
542-
543519 it ( 'should set autorange to true when range input is invalid' , function ( ) {
544520 var layoutIn = { xaxis : { rangeslider : { range : 'not-gonna-work' } } } ,
545521 layoutOut = { xaxis : { } } ,
546522 expected = {
547523 visible : true ,
548524 autorange : true ,
549- range : [ - 1 , 6 ] ,
550525 thickness : 0.15 ,
551526 bgcolor : '#fff' ,
552527 borderwidth : 0 ,
@@ -729,6 +704,17 @@ describe('the range slider', function() {
729704 . then ( function ( ) {
730705 assertRange ( [ - 0.26 , 4.26 ] , [ - 0.26 , 4.26 ] ) ;
731706
707+ // smaller than xaxis.range - won't be accepted
708+ return Plotly . relayout ( gd , { 'xaxis.rangeslider.range' : [ 0 , 2 ] } ) ;
709+ } )
710+ . then ( function ( ) {
711+ assertRange ( [ - 0.26 , 4.26 ] , [ - 0.26 , 4.26 ] ) ;
712+
713+ // will be accepted (and autorange is disabled by impliedEdits)
714+ return Plotly . relayout ( gd , { 'xaxis.rangeslider.range' : [ - 2 , 12 ] } ) ;
715+ } )
716+ . then ( function ( ) {
717+ assertRange ( [ - 0.26 , 4.26 ] , [ - 2 , 12 ] ) ;
732718 } )
733719 . then ( done ) ;
734720 } ) ;
0 commit comments