@@ -175,7 +175,11 @@ describe('ModeBar', function() {
175
175
expectedButtonCount += group . length ;
176
176
} ) ;
177
177
178
- expect ( modeBar . hasButtons ( buttons ) ) . toBe ( true , 'modeBar.hasButtons' ) ;
178
+ var actualButtons = modeBar . buttons . map ( function ( group ) {
179
+ return group . map ( function ( button ) { return button . name ; } ) . join ( ', ' ) ;
180
+ } ) . join ( ' - ' ) ;
181
+
182
+ expect ( modeBar . hasButtons ( buttons ) ) . toBe ( true , 'modeBar.hasButtons: ' + actualButtons ) ;
179
183
expect ( countGroups ( modeBar ) ) . toBe ( expectedGroupCount , 'correct group count' ) ;
180
184
expect ( countButtons ( modeBar ) ) . toBe ( expectedButtonCount , 'correct button count' ) ;
181
185
expect ( countLogo ( modeBar ) ) . toBe ( 1 , 'correct logo count' ) ;
@@ -323,7 +327,8 @@ describe('ModeBar', function() {
323
327
var buttons = getButtons ( [
324
328
[ 'toImage' , 'sendDataToCloud' ] ,
325
329
[ 'pan2d' ] ,
326
- [ 'resetViewMapbox' , 'toggleHover' ]
330
+ [ 'resetViewMapbox' ] ,
331
+ [ 'toggleHover' ]
327
332
] ) ;
328
333
329
334
var gd = getMockGraphInfo ( ) ;
@@ -339,7 +344,8 @@ describe('ModeBar', function() {
339
344
var buttons = getButtons ( [
340
345
[ 'toImage' , 'sendDataToCloud' ] ,
341
346
[ 'pan2d' , 'select2d' , 'lasso2d' ] ,
342
- [ 'resetViewMapbox' , 'toggleHover' ]
347
+ [ 'resetViewMapbox' ] ,
348
+ [ 'toggleHover' ]
343
349
] ) ;
344
350
345
351
var gd = getMockGraphInfo ( ) ;
@@ -393,7 +399,9 @@ describe('ModeBar', function() {
393
399
it ( 'creates mode bar (cartesian + gl3d version)' , function ( ) {
394
400
var buttons = getButtons ( [
395
401
[ 'toImage' , 'sendDataToCloud' ] ,
396
- [ 'resetViews' , 'toggleHover' ]
402
+ [ 'zoom3d' , 'pan3d' , 'orbitRotation' , 'tableRotation' ] ,
403
+ [ 'resetViews' ] ,
404
+ [ 'toggleSpikelines' , 'hoverClosestCartesian' , 'hoverCompareCartesian' ]
397
405
] ) ;
398
406
399
407
var gd = getMockGraphInfo ( ) ;
@@ -405,14 +413,41 @@ describe('ModeBar', function() {
405
413
checkButtons ( modeBar , buttons , 1 ) ;
406
414
} ) ;
407
415
408
- it ( 'creates mode bar (cartesian + geo version)' , function ( ) {
416
+ it ( 'creates mode bar (cartesian + geo unselectable version)' , function ( ) {
409
417
var buttons = getButtons ( [
410
418
[ 'toImage' , 'sendDataToCloud' ] ,
411
- [ 'resetViews' , 'toggleHover' ]
419
+ [ 'zoom2d' , 'pan2d' ] ,
420
+ [ 'zoomIn2d' , 'zoomOut2d' , 'autoScale2d' , 'resetViews' ] ,
421
+ [ 'toggleSpikelines' , 'hoverClosestCartesian' , 'hoverCompareCartesian' ]
412
422
] ) ;
413
423
414
- var gd = getMockGraphInfo ( ) ;
424
+ var gd = getMockGraphInfo ( [ 'x' ] , [ 'y' ] ) ;
425
+ gd . _fullLayout . _basePlotModules = [ { name : 'cartesian' } , { name : 'geo' } ] ;
426
+ gd . _fullLayout . xaxis = { fixedrange : false } ;
427
+
428
+ manageModeBar ( gd ) ;
429
+ var modeBar = gd . _fullLayout . _modeBar ;
430
+
431
+ checkButtons ( modeBar , buttons , 1 ) ;
432
+ } ) ;
433
+
434
+ it ( 'creates mode bar (cartesian + geo selectable version)' , function ( ) {
435
+ var buttons = getButtons ( [
436
+ [ 'toImage' , 'sendDataToCloud' ] ,
437
+ [ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ] ,
438
+ [ 'zoomIn2d' , 'zoomOut2d' , 'autoScale2d' , 'resetViews' ] ,
439
+ [ 'toggleSpikelines' , 'hoverClosestCartesian' , 'hoverCompareCartesian' ]
440
+ ] ) ;
441
+
442
+ var gd = getMockGraphInfo ( [ 'x' ] , [ 'y' ] ) ;
415
443
gd . _fullLayout . _basePlotModules = [ { name : 'cartesian' } , { name : 'geo' } ] ;
444
+ gd . _fullLayout . xaxis = { fixedrange : false } ;
445
+ gd . _fullData = [ {
446
+ type : 'scatter' ,
447
+ visible : true ,
448
+ mode : 'markers' ,
449
+ _module : { selectPoints : true }
450
+ } ] ;
416
451
417
452
manageModeBar ( gd ) ;
418
453
var modeBar = gd . _fullLayout . _modeBar ;
@@ -425,7 +460,7 @@ describe('ModeBar', function() {
425
460
[ 'toImage' , 'sendDataToCloud' ] ,
426
461
[ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ] ,
427
462
[ 'zoomIn2d' , 'zoomOut2d' , 'autoScale2d' , 'resetScale2d' ] ,
428
- [ 'toggleHover ' ]
463
+ [ 'toggleSpikelines' , 'hoverClosestCartesian' , 'hoverCompareCartesian ']
429
464
] ) ;
430
465
431
466
var gd = getMockGraphInfo ( [ 'x' ] , [ 'y' ] ) ;
@@ -447,7 +482,9 @@ describe('ModeBar', function() {
447
482
it ( 'creates mode bar (gl3d + geo version)' , function ( ) {
448
483
var buttons = getButtons ( [
449
484
[ 'toImage' , 'sendDataToCloud' ] ,
450
- [ 'resetViews' , 'toggleHover' ]
485
+ [ 'zoom3d' , 'pan3d' , 'orbitRotation' , 'tableRotation' ] ,
486
+ [ 'resetViews' ] ,
487
+ [ 'toggleHover' ]
451
488
] ) ;
452
489
453
490
var gd = getMockGraphInfo ( ) ;
@@ -462,7 +499,8 @@ describe('ModeBar', function() {
462
499
it ( 'creates mode bar (un-selectable ternary version)' , function ( ) {
463
500
var buttons = getButtons ( [
464
501
[ 'toImage' , 'sendDataToCloud' ] ,
465
- [ 'zoom2d' , 'pan2d' ]
502
+ [ 'zoom2d' , 'pan2d' ] ,
503
+ [ 'toggleHover' ]
466
504
] ) ;
467
505
468
506
var gd = getMockGraphInfo ( ) ;
@@ -477,7 +515,8 @@ describe('ModeBar', function() {
477
515
it ( 'creates mode bar (selectable ternary version)' , function ( ) {
478
516
var buttons = getButtons ( [
479
517
[ 'toImage' , 'sendDataToCloud' ] ,
480
- [ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ]
518
+ [ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ] ,
519
+ [ 'toggleHover' ]
481
520
] ) ;
482
521
483
522
var gd = getMockGraphInfo ( ) ;
@@ -514,7 +553,9 @@ describe('ModeBar', function() {
514
553
it ( 'creates mode bar (ternary + gl3d version)' , function ( ) {
515
554
var buttons = getButtons ( [
516
555
[ 'toImage' , 'sendDataToCloud' ] ,
517
- [ 'resetViews' , 'toggleHover' ]
556
+ [ 'zoom3d' , 'pan3d' , 'orbitRotation' , 'tableRotation' ] ,
557
+ [ 'resetViews' ] ,
558
+ [ 'toggleHover' ]
518
559
] ) ;
519
560
520
561
var gd = getMockGraphInfo ( ) ;
0 commit comments