@@ -154,7 +154,6 @@ describe('ModeBar', function() {
154
154
} ) ;
155
155
156
156
describe ( 'manageModeBar' , function ( ) {
157
-
158
157
function getButtons ( list ) {
159
158
for ( var i = 0 ; i < list . length ; i ++ ) {
160
159
for ( var j = 0 ; j < list [ i ] . length ; j ++ ) {
@@ -174,9 +173,9 @@ describe('ModeBar', function() {
174
173
} ) ;
175
174
176
175
expect ( modeBar . hasButtons ( buttons ) ) . toBe ( true , 'modeBar.hasButtons' ) ;
177
- expect ( countGroups ( modeBar ) ) . toEqual ( expectedGroupCount , 'correct group count' ) ;
178
- expect ( countButtons ( modeBar ) ) . toEqual ( expectedButtonCount , 'correct button count' ) ;
179
- expect ( countLogo ( modeBar ) ) . toEqual ( 1 , 'correct logo count' ) ;
176
+ expect ( countGroups ( modeBar ) ) . toBe ( expectedGroupCount , 'correct group count' ) ;
177
+ expect ( countButtons ( modeBar ) ) . toBe ( expectedButtonCount , 'correct button count' ) ;
178
+ expect ( countLogo ( modeBar ) ) . toBe ( 1 , 'correct logo count' ) ;
180
179
}
181
180
182
181
it ( 'creates mode bar (unselectable cartesian version)' , function ( ) {
@@ -197,7 +196,7 @@ describe('ModeBar', function() {
197
196
checkButtons ( modeBar , buttons , 1 ) ;
198
197
} ) ;
199
198
200
- it ( 'creates mode bar (selectable cartesian version)' , function ( ) {
199
+ it ( 'creates mode bar (selectable scatter version)' , function ( ) {
201
200
var buttons = getButtons ( [
202
201
[ 'toImage' , 'sendDataToCloud' ] ,
203
202
[ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ] ,
@@ -221,6 +220,30 @@ describe('ModeBar', function() {
221
220
checkButtons ( modeBar , buttons , 1 ) ;
222
221
} ) ;
223
222
223
+ it ( 'creates mode bar (selectable box version)' , function ( ) {
224
+ var buttons = getButtons ( [
225
+ [ 'toImage' , 'sendDataToCloud' ] ,
226
+ [ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ] ,
227
+ [ 'zoomIn2d' , 'zoomOut2d' , 'autoScale2d' , 'resetScale2d' ] ,
228
+ [ 'toggleSpikelines' , 'hoverClosestCartesian' , 'hoverCompareCartesian' ]
229
+ ] ) ;
230
+
231
+ var gd = getMockGraphInfo ( ) ;
232
+ gd . _fullLayout . _basePlotModules = [ { name : 'cartesian' } ] ;
233
+ gd . _fullLayout . xaxis = { fixedrange : false } ;
234
+ gd . _fullData = [ {
235
+ type : 'box' ,
236
+ visible : true ,
237
+ boxpoints : 'all' ,
238
+ _module : { selectPoints : true }
239
+ } ] ;
240
+
241
+ manageModeBar ( gd ) ;
242
+ var modeBar = gd . _fullLayout . _modeBar ;
243
+
244
+ checkButtons ( modeBar , buttons , 1 ) ;
245
+ } ) ;
246
+
224
247
it ( 'creates mode bar (cartesian fixed-axes version)' , function ( ) {
225
248
var buttons = getButtons ( [
226
249
[ 'toImage' , 'sendDataToCloud' ] ,
0 commit comments