Skip to content

Commit 476c8b7

Browse files
committed
Add failing test for groupby colors
1 parent 5e70d3b commit 476c8b7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/jasmine/tests/transform_groupby_test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,23 @@ describe('groupby', function() {
6363
});
6464
});
6565

66+
it('varies the color for each expanded trace', function () {
67+
var uniqueColors = {};
68+
var dataOut = [];
69+
var dataIn = [{
70+
y: [1, 2, 3],
71+
transforms: [{type: 'groupby', groups: ['a', 'b', 'c']}]
72+
}];
73+
74+
Plots.supplyDataDefaults(dataIn, dataOut, {}, {});
75+
76+
for (var i = 0; i < dataOut.length; i++) {
77+
uniqueColors[dataOut[i].marker.color] = true;
78+
}
79+
80+
expect(Object.keys(uniqueColors).length).toEqual(3);
81+
});
82+
6683
it('Accepts deprecated object notation for styles', function(done) {
6784
var oldStyleMockData = [{
6885
mode: 'markers',

0 commit comments

Comments
 (0)