Numeric histogram: Test when start and end are provided but not bins

This commit is contained in:
Raul Marin
2019-03-14 15:16:23 +01:00
committed by Raul Marin
parent 730076469e
commit 8db090ae9c
2 changed files with 21 additions and 0 deletions
+20
View File
@@ -90,6 +90,26 @@ describe('histogram-dataview', function() {
});
});
it('should work with min >= start and max <= end, autodetect bins', function(done) {
var params = {
start: 50,
end: 500
};
this.testClient = new TestClient(mapConfig, 1234);
this.testClient.getDataview('pop_max_histogram', params, function(err, dataview) {
assert.ok(!err, err);
assert.ok(6 === dataview.bins_count, 'Unexpected bin count: ' + dataview.bins_count);
assert.ok(6 === dataview.bins.length, 'Unexpected number of bins: ' + dataview.bins.length);
dataview.bins.forEach(function(bin) {
assert.ok(bin.min >= params.start, 'bin min < start: ' + JSON.stringify(bin));
assert.ok(bin.max <= params.end, 'bin max > end: ' + JSON.stringify(bin));
});
done();
});
});
it('should get bin_width right when max > min in filter', function(done) {
var params = {
bins: 10,