From 924f00939000ee99adc8284abae59ed1086b32ab Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 13 Mar 2017 18:36:43 +0100 Subject: [PATCH] Test for #606: function avg(timestamp with time zone) does not exist --- test/acceptance/widgets/ported/histogram.js | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/acceptance/widgets/ported/histogram.js b/test/acceptance/widgets/ported/histogram.js index 0f5c9d8e..90dfe840 100644 --- a/test/acceptance/widgets/ported/histogram.js +++ b/test/acceptance/widgets/ported/histogram.js @@ -304,6 +304,37 @@ describe('widgets', function() { }); }); + it('can use a datetime filtered column with no results', function(done) { + this.testClient = new TestClient(histogramsMapConfig({ + updated_at: { + type: 'histogram', + options: { + column: 'updated_at' + } + } + })); + var params = { + own_filter: 1, + filters: { + layers: [{ + updated_at: { + // this will remove all results + max: -1 + } + }] + } + }; + this.testClient.getWidget('updated_at', params, function (err, res, histogram) { + assert.ok(!err, err); + assert.ok(histogram); + assert.equal(histogram.type, 'histogram'); + + assert.equal(histogram.bins.length, 0); + + done(); + }); + }); + it('can getTile with datetime filtered column', function(done) { this.testClient = new TestClient(histogramsMapConfig({ updated_at: {