Skip to content

Commit c8a13b8

Browse files
committed
test: add case where axis type is set by user
1 parent 7a98f15 commit c8a13b8

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

test/jasmine/tests/transform_filter_test.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ describe('filter transforms calc:', function() {
8484
return calcTrace[0].trace;
8585
}
8686

87-
function _transform(data) {
87+
function _transform(data, layout) {
8888
var gd = {
8989
data: data,
90-
layout: {}
90+
layout: layout || {}
9191
};
9292

9393
Plots.supplyDefaults(gd);
@@ -256,6 +256,21 @@ describe('filter transforms calc:', function() {
256256
);
257257
});
258258

259+
it('should honored set axis type', function() {
260+
var out = _transform([Lib.extendDeep({}, _base, {
261+
x: [1, 2, 3, 0, -1, -2, -3],
262+
transforms: [{
263+
operation: '>',
264+
value: -1,
265+
filtersrc: 'x'
266+
}]
267+
})], {
268+
xaxis: { type: 'category' }
269+
});
270+
271+
_assert(out, [-2, -3], [3, 1], [0.3, 0.4]);
272+
});
273+
259274
});
260275

261276
describe('filters should handle categories', function() {

0 commit comments

Comments
 (0)