@@ -467,6 +467,10 @@ describe('Test axes', function() {
467
467
] ) ;
468
468
} ) ;
469
469
470
+ var warnTxt = ' to avoid either an infinite loop and possibly ' +
471
+ 'inconsistent scaleratios, or because the targetaxis has ' +
472
+ 'fixed range.' ;
473
+
470
474
it ( 'breaks scaleanchor loops and drops conflicting ratios' , function ( ) {
471
475
var warnings = [ ] ;
472
476
spyOn ( Lib , 'warn' ) . and . callFake ( function ( msg ) {
@@ -493,10 +497,6 @@ describe('Test axes', function() {
493
497
{ x2 : 5 * 7 * 9 , y2 : 7 * 9 , y3 : 1 , x3 : 9 }
494
498
] ) ;
495
499
496
- var warnTxt = ' to avoid either an infinite loop and possibly ' +
497
- 'inconsistent scaleratios, or because the targetaxis has ' +
498
- 'fixed range.' ;
499
-
500
500
expect ( warnings ) . toEqual ( [
501
501
'ignored yaxis.scaleanchor: "x"' + warnTxt ,
502
502
'ignored yaxis3.scaleanchor: "x2"' + warnTxt
@@ -510,15 +510,15 @@ describe('Test axes', function() {
510
510
} ) ;
511
511
512
512
layoutIn = {
513
- xaxis : { scaleanchor : 'x' , scaleratio : 2 } , // can't link to itself
513
+ xaxis : { scaleanchor : 'x' , scaleratio : 2 } , // can't link to itself - this one isn't ignored...
514
514
yaxis : { scaleanchor : 'x4' , scaleratio : 3 } , // doesn't exist
515
515
xaxis2 : { scaleanchor : 'yaxis' , scaleratio : 5 } // must be an id, not a name
516
516
} ;
517
517
518
518
supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
519
519
520
520
expect ( layoutOut . _axisConstraintGroups ) . toEqual ( [ ] ) ;
521
- expect ( warnings ) . toEqual ( [ ] ) ;
521
+ expect ( warnings ) . toEqual ( [ 'ignored xaxis.scaleanchor: "x"' + warnTxt ] ) ;
522
522
523
523
[ 'xaxis' , 'yaxis' , 'xaxis2' ] . forEach ( function ( axName ) {
524
524
expect ( layoutOut [ axName ] . scaleanchor ) . toBeUndefined ( axName ) ;
0 commit comments