@@ -202,9 +202,9 @@ describe('ModeBar', function() {
202
202
gd . _fullLayout . _hasCartesian = true ;
203
203
gd . _fullLayout . xaxis = { fixedrange : false } ;
204
204
gd . _fullData = [ {
205
- type :'scatter' ,
205
+ type : 'scatter' ,
206
206
visible : true ,
207
- mode :'markers' ,
207
+ mode : 'markers' ,
208
208
_module : { selectPoints : true }
209
209
} ] ;
210
210
@@ -295,6 +295,91 @@ describe('ModeBar', function() {
295
295
checkButtons ( modeBar , buttons , 1 ) ;
296
296
} ) ;
297
297
298
+ it ( 'creates mode bar (cartesian + gl3d version)' , function ( ) {
299
+ var buttons = getButtons ( [
300
+ [ 'toImage' , 'sendDataToCloud' ] ,
301
+ [ 'resetViews' , 'toggleHover' ]
302
+ ] ) ;
303
+
304
+ var gd = getMockGraphInfo ( ) ;
305
+ gd . _fullLayout . _hasCartesian = true ;
306
+ gd . _fullLayout . _hasGL3D = true ;
307
+ gd . _fullLayout . _hasGeo = false ;
308
+ gd . _fullLayout . _hasGL2D = false ;
309
+ gd . _fullLayout . _hasPie = false ;
310
+
311
+ manageModeBar ( gd ) ;
312
+ var modeBar = gd . _fullLayout . _modeBar ;
313
+
314
+ checkButtons ( modeBar , buttons , 1 ) ;
315
+ } ) ;
316
+
317
+ it ( 'creates mode bar (cartesian + geo version)' , function ( ) {
318
+ var buttons = getButtons ( [
319
+ [ 'toImage' , 'sendDataToCloud' ] ,
320
+ [ 'resetViews' , 'toggleHover' ]
321
+ ] ) ;
322
+
323
+ var gd = getMockGraphInfo ( ) ;
324
+ gd . _fullLayout . _hasCartesian = true ;
325
+ gd . _fullLayout . _hasGL3D = false ;
326
+ gd . _fullLayout . _hasGeo = true ;
327
+ gd . _fullLayout . _hasGL2D = false ;
328
+ gd . _fullLayout . _hasPie = false ;
329
+
330
+ manageModeBar ( gd ) ;
331
+ var modeBar = gd . _fullLayout . _modeBar ;
332
+
333
+ checkButtons ( modeBar , buttons , 1 ) ;
334
+ } ) ;
335
+
336
+ it ( 'creates mode bar (cartesian + pie version)' , function ( ) {
337
+ var buttons = getButtons ( [
338
+ [ 'toImage' , 'sendDataToCloud' ] ,
339
+ [ 'zoom2d' , 'pan2d' , 'select2d' , 'lasso2d' ] ,
340
+ [ 'zoomIn2d' , 'zoomOut2d' , 'autoScale2d' , 'resetScale2d' ] ,
341
+ [ 'toggleHover' ]
342
+ ] ) ;
343
+
344
+ var gd = getMockGraphInfo ( ) ;
345
+ gd . _fullLayout . _hasCartesian = true ;
346
+ gd . _fullData = [ {
347
+ type : 'scatter' ,
348
+ visible : true ,
349
+ mode : 'markers' ,
350
+ _module : { selectPoints : true }
351
+ } ] ;
352
+ gd . _fullLayout . xaxis = { fixedrange : false } ;
353
+ gd . _fullLayout . _hasGL3D = false ;
354
+ gd . _fullLayout . _hasGeo = false ;
355
+ gd . _fullLayout . _hasGL2D = false ;
356
+ gd . _fullLayout . _hasPie = true ;
357
+
358
+ manageModeBar ( gd ) ;
359
+ var modeBar = gd . _fullLayout . _modeBar ;
360
+
361
+ checkButtons ( modeBar , buttons , 1 ) ;
362
+ } ) ;
363
+
364
+ it ( 'creates mode bar (gl3d + geo version)' , function ( ) {
365
+ var buttons = getButtons ( [
366
+ [ 'toImage' , 'sendDataToCloud' ] ,
367
+ [ 'resetViews' , 'toggleHover' ]
368
+ ] ) ;
369
+
370
+ var gd = getMockGraphInfo ( ) ;
371
+ gd . _fullLayout . _hasCartesian = false ;
372
+ gd . _fullLayout . _hasGL3D = true ;
373
+ gd . _fullLayout . _hasGeo = true ;
374
+ gd . _fullLayout . _hasGL2D = false ;
375
+ gd . _fullLayout . _hasPie = false ;
376
+
377
+ manageModeBar ( gd ) ;
378
+ var modeBar = gd . _fullLayout . _modeBar ;
379
+
380
+ checkButtons ( modeBar , buttons , 1 ) ;
381
+ } ) ;
382
+
298
383
it ( 'throws an error if modeBarButtonsToRemove isn\'t an array' , function ( ) {
299
384
var gd = getMockGraphInfo ( ) ;
300
385
gd . _context . modeBarButtonsToRemove = 'not gonna work' ;
0 commit comments