@@ -175,7 +175,11 @@ describe('ModeBar', function() {
175175 expectedButtonCount += group . length ;
176176 } ) ;
177177
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 ) ;
179183 expect ( countGroups ( modeBar ) ) . toBe ( expectedGroupCount , 'correct group count' ) ;
180184 expect ( countButtons ( modeBar ) ) . toBe ( expectedButtonCount , 'correct button count' ) ;
181185 expect ( countLogo ( modeBar ) ) . toBe ( 1 , 'correct logo count' ) ;
@@ -323,7 +327,8 @@ describe('ModeBar', function() {
323327 var buttons = getButtons ( [
324328 [ 'toImage' , 'sendDataToCloud' ] ,
325329 [ 'pan2d' ] ,
326- [ 'resetViewMapbox' , 'toggleHover' ]
330+ [ 'resetViewMapbox' ] ,
331+ [ 'toggleHover' ]
327332 ] ) ;
328333
329334 var gd = getMockGraphInfo ( ) ;
@@ -339,7 +344,8 @@ describe('ModeBar', function() {
339344 var buttons = getButtons ( [
340345 [ 'toImage' , 'sendDataToCloud' ] ,
341346 [ 'pan2d' , 'select2d' , 'lasso2d' ] ,
342- [ 'resetViewMapbox' , 'toggleHover' ]
347+ [ 'resetViewMapbox' ] ,
348+ [ 'toggleHover' ]
343349 ] ) ;
344350
345351 var gd = getMockGraphInfo ( ) ;
@@ -393,7 +399,9 @@ describe('ModeBar', function() {
393399 it ( 'creates mode bar (cartesian + gl3d version)' , function ( ) {
394400 var buttons = getButtons ( [
395401 [ 'toImage' , 'sendDataToCloud' ] ,
396- [ 'resetViews' , 'toggleHover' ]
402+ [ 'zoom3d' , 'pan3d' , 'orbitRotation' , 'tableRotation' ] ,
403+ [ 'resetViews' ] ,
404+ [ 'toggleSpikelines' , 'hoverClosestCartesian' , 'hoverCompareCartesian' ]
397405 ] ) ;
398406
399407 var gd = getMockGraphInfo ( ) ;
@@ -405,14 +413,41 @@ describe('ModeBar', function() {
405413 checkButtons ( modeBar , buttons , 1 ) ;
406414 } ) ;
407415
408- it ( 'creates mode bar (cartesian + geo version)' , function ( ) {
416+ it ( 'creates mode bar (cartesian + geo unselectable version)' , function ( ) {
409417 var buttons = getButtons ( [
410418 [ 'toImage' , 'sendDataToCloud' ] ,
411- [ 'resetViews' , 'toggleHover' ]
419+ [ 'zoom2d' , 'pan2d' ] ,
420+ [ 'zoomIn2d' , 'zoomOut2d' , 'autoScale2d' , 'resetViews' ] ,
421+ [ 'toggleSpikelines' , 'hoverClosestCartesian' , 'hoverCompareCartesian' ]
412422 ] ) ;
413423
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' ] ) ;
415443 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+ } ] ;
416451
417452 manageModeBar ( gd ) ;
418453 var modeBar = gd . _fullLayout . _modeBar ;
@@ -425,7 +460,7 @@ describe('ModeBar', function() {
425460 [ 'toImage' , 'sendDataToCloud' ] ,
426461 [ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ] ,
427462 [ 'zoomIn2d' , 'zoomOut2d' , 'autoScale2d' , 'resetScale2d' ] ,
428- [ 'toggleHover ' ]
463+ [ 'toggleSpikelines' , 'hoverClosestCartesian' , 'hoverCompareCartesian ']
429464 ] ) ;
430465
431466 var gd = getMockGraphInfo ( [ 'x' ] , [ 'y' ] ) ;
@@ -447,7 +482,9 @@ describe('ModeBar', function() {
447482 it ( 'creates mode bar (gl3d + geo version)' , function ( ) {
448483 var buttons = getButtons ( [
449484 [ 'toImage' , 'sendDataToCloud' ] ,
450- [ 'resetViews' , 'toggleHover' ]
485+ [ 'zoom3d' , 'pan3d' , 'orbitRotation' , 'tableRotation' ] ,
486+ [ 'resetViews' ] ,
487+ [ 'toggleHover' ]
451488 ] ) ;
452489
453490 var gd = getMockGraphInfo ( ) ;
@@ -462,7 +499,8 @@ describe('ModeBar', function() {
462499 it ( 'creates mode bar (un-selectable ternary version)' , function ( ) {
463500 var buttons = getButtons ( [
464501 [ 'toImage' , 'sendDataToCloud' ] ,
465- [ 'zoom2d' , 'pan2d' ]
502+ [ 'zoom2d' , 'pan2d' ] ,
503+ [ 'toggleHover' ]
466504 ] ) ;
467505
468506 var gd = getMockGraphInfo ( ) ;
@@ -477,7 +515,8 @@ describe('ModeBar', function() {
477515 it ( 'creates mode bar (selectable ternary version)' , function ( ) {
478516 var buttons = getButtons ( [
479517 [ 'toImage' , 'sendDataToCloud' ] ,
480- [ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ]
518+ [ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ] ,
519+ [ 'toggleHover' ]
481520 ] ) ;
482521
483522 var gd = getMockGraphInfo ( ) ;
@@ -514,7 +553,9 @@ describe('ModeBar', function() {
514553 it ( 'creates mode bar (ternary + gl3d version)' , function ( ) {
515554 var buttons = getButtons ( [
516555 [ 'toImage' , 'sendDataToCloud' ] ,
517- [ 'resetViews' , 'toggleHover' ]
556+ [ 'zoom3d' , 'pan3d' , 'orbitRotation' , 'tableRotation' ] ,
557+ [ 'resetViews' ] ,
558+ [ 'toggleHover' ]
518559 ] ) ;
519560
520561 var gd = getMockGraphInfo ( ) ;
0 commit comments