Commit aaf59f92 authored by Mikaël Salson's avatar Mikaël Salson

axis_test.js: Make sure that undefined values are properly handled in axes

This was not the case when all the values were undefined (as with cloneDB occurrences).
We need just two labels, when with 0 and the other one with undefined.
parent e5f9cfb6
Pipeline #35047 passed with stages
in 5 minutes and 28 seconds
......@@ -148,4 +148,21 @@ QUnit.test("axis", function(assert) {
return clone.getName();
})
assert.equal(axis.pos(m.clone(0)).pos.toPrecision(3), 0.0625, "generic (name : clone 0 ")
// undefined values
axis = new NumericalAxis(m);
axis.init(m.clones,
function(clone) {
return undefined;
}, "V", true, 0);
assert.equal(axis.labels.length, 2, "Just two labels: 0, undefined");
// undefined values
axis = new NumericalAxis(m);
axis.init(m.clones,
function(clone) {
return 'undefined';
});
assert.equal(axis.labels[0].pos, 1, "Just two labels: undefined, 0");
assert.equal(axis.labels[1].pos, 0, "Just two labels: undefined, 0");
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment