File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1449,6 +1449,38 @@ describe('Test axes', function() {
1449
1449
expect ( ax . _min ) . toEqual ( [ { val : 0 , pad : 0 } ] ) ;
1450
1450
expect ( ax . _max ) . toEqual ( [ { val : 6 , pad : 15 } ] ) ;
1451
1451
} ) ;
1452
+
1453
+ it ( 'should return early if no data is given' , function ( ) {
1454
+ ax = getDefaultAx ( ) ;
1455
+
1456
+ expand ( ax ) ;
1457
+ expect ( ax . _min ) . toBeUndefined ( ) ;
1458
+ expect ( ax . _max ) . toBeUndefined ( ) ;
1459
+ } ) ;
1460
+
1461
+ it ( 'should return early if `autorange` is falsy' , function ( ) {
1462
+ ax = getDefaultAx ( ) ;
1463
+ data = [ 2 , 5 ] ;
1464
+
1465
+ ax . autorange = false ;
1466
+ ax . rangeslider = { autorange : false } ;
1467
+
1468
+ expand ( ax , data , { } ) ;
1469
+ expect ( ax . _min ) . toBeUndefined ( ) ;
1470
+ expect ( ax . _max ) . toBeUndefined ( ) ;
1471
+ } ) ;
1472
+
1473
+ it ( 'should consider range slider `autorange`' , function ( ) {
1474
+ ax = getDefaultAx ( ) ;
1475
+ data = [ 2 , 5 ] ;
1476
+
1477
+ ax . autorange = false ;
1478
+ ax . rangeslider = { autorange : true } ;
1479
+
1480
+ expand ( ax , data , { } ) ;
1481
+ expect ( ax . _min ) . toEqual ( [ { val : 2 , pad : 0 } ] ) ;
1482
+ expect ( ax . _max ) . toEqual ( [ { val : 5 , pad : 0 } ] ) ;
1483
+ } ) ;
1452
1484
} ) ;
1453
1485
1454
1486
describe ( 'calcTicks and tickText' , function ( ) {
You can’t perform that action at this time.
0 commit comments