diff --git a/test/acceptance/cluster.js b/test/acceptance/cluster.js index 632b6e8a..9a1e9a3a 100644 --- a/test/acceptance/cluster.js +++ b/test/acceptance/cluster.js @@ -9,7 +9,7 @@ const POINTS_SQL_1 = ` select x + 4 as cartodb_id, st_setsrid(st_makepoint(x*10, x*10), 4326) as the_geom, - st_transform(st_setsrid(st_makepoint(x*10, x*10), 4326), 3857) as the_geom_webmercator, + st_transform(st_setsrid(st_makepoint(x*10 + 10, x*10 + 10), 4326), 3857) as the_geom_webmercator, x as value, CASE WHEN x % 2 = 0 THEN 'even' @@ -62,14 +62,14 @@ describe('cluster', function () { } assert.deepStrictEqual(body, { - errors:[ 'Map c502fc8fc1cb0d5e412db3deabffeee5 has no aggregation defined for layer 0' ], + errors:[ 'Map 22771437ab05d49179f535c790a347c3 has no aggregation defined for layer 0' ], errors_with_context:[ { layer: { index: '0', type: 'cartodb' }, - message: 'Map c502fc8fc1cb0d5e412db3deabffeee5 has no aggregation defined for layer 0', + message: 'Map 22771437ab05d49179f535c790a347c3 has no aggregation defined for layer 0', subtype: 'aggregation', type: 'layer' } @@ -104,14 +104,14 @@ describe('cluster', function () { } assert.deepStrictEqual(body, { - errors:[ 'Map 18792467ae296929d04e32dfe7f81a80 has no aggregation defined for layer 0' ], + errors:[ 'Map c7fbde4bbf7cc73692b4f3767d5c6604 has no aggregation defined for layer 0' ], errors_with_context:[ { layer: { index: '0', type: 'cartodb' }, - message: 'Map 18792467ae296929d04e32dfe7f81a80 has no aggregation defined for layer 0', + message: 'Map c7fbde4bbf7cc73692b4f3767d5c6604 has no aggregation defined for layer 0', subtype: 'aggregation', type: 'layer' } @@ -216,8 +216,7 @@ describe('cluster', function () { expected: [ { cartodb_id: 1, value: -3, type: 'odd' }, { cartodb_id: 2, value: -2, type: 'even' }, - { cartodb_id: 3, value: -1, type: 'odd' }, - { cartodb_id: 4, value: 0, type: 'even' }, + { cartodb_id: 3, value: -1, type: 'odd' } ] }, { @@ -225,6 +224,7 @@ describe('cluster', function () { cartodb_id: 5, resolution: 50, expected: [ + { cartodb_id: 4, value: 0, type: 'even' }, { cartodb_id: 5, value: 1, type: 'odd' }, { cartodb_id: 6, value: 2, type: 'even' }, { cartodb_id: 7, value: 3, type: 'odd' } @@ -279,8 +279,7 @@ describe('cluster', function () { expected: [ { cartodb_id: 1, value: -3, type: 'odd' }, { cartodb_id: 2, value: -2, type: 'even'}, - { cartodb_id: 3, value: -1, type: 'odd' }, - { cartodb_id: 4, value: 0, type: 'even' }, + { cartodb_id: 3, value: -1, type: 'odd' } ] }, { @@ -288,9 +287,9 @@ describe('cluster', function () { cartodb_id: 5, resolution: 50, expected: [ + { cartodb_id: 4, value: 0, type: 'even' }, { cartodb_id: 5, value: 1, type: 'odd' }, - { cartodb_id: 6, value: 2, type: 'even' }, - { cartodb_id: 7, value: 3, type: 'odd' } + { cartodb_id: 6, value: 2, type: 'even' } ] } ]; @@ -381,7 +380,7 @@ describe('cluster', function () { resolution: 50, aggregation: { columns: ['type'] }, expected: [ - { _cdb_feature_count: 2, type: 'even' }, + { _cdb_feature_count: 1, type: 'even' }, { _cdb_feature_count: 2, type: 'odd' } ] }, @@ -391,7 +390,7 @@ describe('cluster', function () { resolution: 50, aggregation: { columns: ['type'] }, expected: [ - { _cdb_feature_count: 1, type: 'even' }, + { _cdb_feature_count: 2, type: 'even' }, { _cdb_feature_count: 2, type: 'odd' } ] }, @@ -514,7 +513,7 @@ describe('cluster', function () { } }, expected: [ - { _cdb_feature_count: 2, type: 'even', max_value: 0 }, + { _cdb_feature_count: 1, type: 'even', max_value: -2 }, { _cdb_feature_count: 2, type: 'odd', max_value: -1 } ] }, @@ -532,14 +531,14 @@ describe('cluster', function () { } }, expected: [ - { _cdb_feature_count: 1, type: 'even', max_value: 2 }, + { _cdb_feature_count: 2, type: 'even', max_value: 2 }, { _cdb_feature_count: 2, type: 'odd', max_value: 3 } ] } ]; suite.forEach(({ zoom, cartodb_id, resolution, aggregation, expected }) => { - it('should return features aggregated by type', function (done) { + it(`should aggregate by type; z: ${zoom}, cartodb_id: ${cartodb_id}, res: ${resolution}`, function (done) { const mapConfig = createVectorMapConfig([{ type: 'cartodb', options: {