Skip to content

Commit bc3890b

Browse files
committed
bar trace: 🔒 down default layout.barmode
1 parent 7ec042a commit bc3890b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/jasmine/tests/bar_test.js

+14
Original file line numberDiff line numberDiff 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

231245
describe('bar calc / crossTraceCalc (formerly known as setPositions)', function() {

0 commit comments

Comments
 (0)