From 7c9b4b7283fec02d4150bb0e97211c28427d83de Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Mon, 29 Jan 2018 12:40:59 +0100 Subject: [PATCH] Add test to check that cartodb_id is preseent in aggregations See #846 This revealss that point-grid aggregation is missing cartodb_id --- test/acceptance/aggregation.js | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/test/acceptance/aggregation.js b/test/acceptance/aggregation.js index f601ca1d..4978b920 100644 --- a/test/acceptance/aggregation.js +++ b/test/acceptance/aggregation.js @@ -1366,6 +1366,41 @@ describe('aggregation', function () { }); }); }); + + ['centroid', 'point-sample', 'point-grid'].forEach(placement => { + it(`cartodb_id should be present in ${placement} aggregation`, function(done) { + this.mapConfig = createVectorMapConfig([ + { + type: 'cartodb', + options: { + sql: POINTS_SQL_1, + aggregation: { + placement: placement, + threshold: 1 + }, + cartocss: '#layer { marker-width: 1; }', + cartocss_version: '2.3.0', + interactivity: ['cartodb_id'] + } + } + ]); + + this.testClient = new TestClient(this.mapConfig); + this.testClient.getLayergroup((err, body) => { + if (err) { + return done(err); + } + + assert.equal(typeof body.metadata, 'object'); + assert.ok(Array.isArray(body.metadata.layers)); + + body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); + body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.png)); + + done(); + }); + }); + }); }); }); });