File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,20 @@ describe('Bar.supplyDefaults', function() {
226
226
expect ( gd . _fullData [ 0 ] . alignmentgroup ) . toBe ( undefined , 'alignementgroup' ) ;
227
227
expect ( gd . _fullData [ 0 ] . offsetgroup ) . toBe ( undefined , 'offsetgroup' ) ;
228
228
} ) ;
229
+
230
+ it ( 'should have a barmode only if it contains bars' , function ( ) {
231
+ var gd = {
232
+ data : [ { type : 'histogram' , y : [ 1 ] , visible : false } ] ,
233
+ layout : { }
234
+ } ;
235
+
236
+ supplyAllDefaults ( gd ) ;
237
+ expect ( gd . _fullLayout . barmode ) . toBe ( undefined , '`barmode` should be undefined' ) ;
238
+
239
+ gd . data [ 0 ] . visible = true ;
240
+ supplyAllDefaults ( gd ) ;
241
+ expect ( gd . _fullLayout . barmode ) . toBe ( 'group' , '`barmode` should be set to its default ' ) ;
242
+ } ) ;
229
243
} ) ;
230
244
231
245
describe ( 'bar calc / crossTraceCalc (formerly known as setPositions)' , function ( ) {
You can’t perform that action at this time.
0 commit comments