Merge pull request #826 from CartoDB/fix-typo-dimensions

Fix typo
This commit is contained in:
Daniel 2017-12-20 15:02:32 +01:00 committed by GitHub
commit 8259271184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 2 deletions

View File

@ -59,7 +59,7 @@ module.exports = class AggregationMapConfig extends MapConfig {
threshold = AggregationMapConfig.THRESHOLD,
placement = AggregationMapConfig.PLACEMENT,
columns = {},
dimmensions = {}
dimensions = {}
} = this.getAggregation(index);
return aggregationQuery({
@ -68,7 +68,7 @@ module.exports = class AggregationMapConfig extends MapConfig {
threshold,
placement,
columns,
dimmensions
dimensions
});
}

View File

@ -529,6 +529,46 @@ describe('aggregation', function () {
});
});
it('when dimensions is provided should return a tile returning the column used as dimensions',
function (done) {
// FIXME: skip until pg-mvt renderer is able to return all columns
if (process.env.POSTGIS_VERSION === '2.4') {
return done();
}
this.mapConfig = createVectorMapConfig([
{
type: 'cartodb',
options: {
sql: POINTS_SQL_1,
aggregation: {
threshold: 1,
dimensions: {
value: "value"
}
}
}
}
]);
this.testClient = new TestClient(this.mapConfig);
const options = {
format: 'mvt'
};
this.testClient.getTile(0, 0, 0, options, (err, res, tile) => {
if (err) {
return done(err);
}
const tileJSON = tile.toJSON();
tileJSON[0].features.forEach(feature => assert.equal(typeof feature.properties.value, 'number'));
done();
});
});
it('should work when the sql has single quotes', function (done) {
this.mapConfig = createVectorMapConfig([
{