Skip to content

Commit 7aecfb2

Browse files
committed
add jasmine test to lock issue 5731
1 parent 4b1da24 commit 7aecfb2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

test/jasmine/tests/bar_test.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -981,12 +981,10 @@ describe('Bar.crossTraceCalc (formerly known as setPositions)', function() {
981981

982982
it('should set unit width for categories in overlay mode', function() {
983983
var gd = mockBarPlot([{
984-
type: 'bar',
985984
x: ['a', 'b', 'c'],
986985
y: [2, 2, 2]
987986
},
988987
{
989-
type: 'bar',
990988
x: ['a', 'c'],
991989
y: [1, 1]
992990
}], {
@@ -996,6 +994,20 @@ describe('Bar.crossTraceCalc (formerly known as setPositions)', function() {
996994
expect(gd.calcdata[1][0].t.bardelta).toBe(1);
997995
});
998996

997+
it('should set unit width for categories case of missing data for defined category', function() {
998+
var gd = mockBarPlot([{
999+
x: ['a', 'c'],
1000+
y: [1, 2]
1001+
}, {
1002+
x: ['a', 'c'],
1003+
y: [1, 2],
1004+
}], {
1005+
xaxis: { categoryarray: ['a', 'b', 'c'] }
1006+
});
1007+
1008+
expect(gd.calcdata[1][0].t.bardelta).toBe(1);
1009+
});
1010+
9991011
describe('should relative-stack bar within the same trace that overlap under barmode=group', function() {
10001012
it('- base case', function() {
10011013
var gd = mockBarPlot([{

0 commit comments

Comments
 (0)