File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 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() {
226226 expect ( gd . _fullData [ 0 ] . alignmentgroup ) . toBe ( undefined , 'alignementgroup' ) ;
227227 expect ( gd . _fullData [ 0 ] . offsetgroup ) . toBe ( undefined , 'offsetgroup' ) ;
228228 } ) ;
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+ } ) ;
229243} ) ;
230244
231245describe ( 'bar calc / crossTraceCalc (formerly known as setPositions)' , function ( ) {
You can’t perform that action at this time.
0 commit comments