Skip to content

Commit cc3012a

Browse files
author
John Soklaski
committed
Add regression test
1 parent 21d813e commit cc3012a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/jasmine/tests/calcdata_test.js

+12
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,18 @@ describe('calculated data and points', function() {
137137
expect(gd.calcdata[0][3]).toEqual(jasmine.objectContaining({x: 0, y: 13}));
138138
expect(gd.calcdata[0][4]).toEqual(jasmine.objectContaining({x: 2, y: 14}));
139139
});
140+
141+
it('should combine duplicate categories', function() {
142+
Plotly.plot(gd, [{x: [ '1', '1'], y: [10, 20]}], { xaxis: {
143+
type: 'category',
144+
categoryorder: 'category ascending'
145+
}});
146+
147+
expect(gd.calcdata[0][0]).toEqual(jasmine.objectContaining({x: 0, y: 10}));
148+
expect(gd.calcdata[0][1]).toEqual(jasmine.objectContaining({x: 0, y: 20}));
149+
150+
expect(gd._fullLayout.xaxis._categories).toEqual(['1']);
151+
});
140152
});
141153

142154
describe('explicit category ordering', function() {

0 commit comments

Comments
 (0)