From ef39f23d1f4f4d2148d02854e4f5c1d2c7e624b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Tue, 9 Jul 2019 14:47:40 +0200 Subject: [PATCH] Fix tests to use map-config builder properly --- test/acceptance/cache/cache-control-header.js | 74 ++++++++++--------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/test/acceptance/cache/cache-control-header.js b/test/acceptance/cache/cache-control-header.js index 0d6427b2..b2d6abae 100644 --- a/test/acceptance/cache/cache-control-header.js +++ b/test/acceptance/cache/cache-control-header.js @@ -36,14 +36,16 @@ describe('cache-control header', function () { describe('max-age directive', function () { it('tile from a table which is included in cdb_tablemetada', function (done) { const ttl = ONE_YEAR_IN_SECONDS; - const mapConfig = createMapConfig([{ - type: 'cartodb', - options: { - sql: 'select * from test_table', - cartocss: TestClient.CARTOCSS.POINTS, - cartocss_version: '2.3.0' - } - }]); + const mapConfig = createMapConfig({ + layers: [{ + type: 'cartodb', + options: { + sql: 'select * from test_table', + cartocss: TestClient.CARTOCSS.POINTS, + cartocss_version: '2.3.0' + } + }] + }); const testClient = new TestClient(mapConfig); @@ -59,14 +61,16 @@ describe('cache-control header', function () { it('tile from a table which is NOT included in cdb_tablemetada', function (done) { const ttl = global.environment.varnish.fallbackTtl || FIVE_MINUTES_IN_SECONDS; - const mapConfig = createMapConfig([{ - type: 'cartodb', - options: { - sql: 'select * from test_table_2', - cartocss: TestClient.CARTOCSS.POINTS, - cartocss_version: '2.3.0' - } - }]); + const mapConfig = createMapConfig({ + layers: [{ + type: 'cartodb', + options: { + sql: 'select * from test_table_2', + cartocss: TestClient.CARTOCSS.POINTS, + cartocss_version: '2.3.0' + } + }] + }); const testClient = new TestClient(mapConfig); @@ -82,24 +86,26 @@ describe('cache-control header', function () { it('tile from joined tables which one of them is NOT included in cdb_tablemetada', function (done) { const ttl = global.environment.varnish.fallbackTtl || FIVE_MINUTES_IN_SECONDS; - const mapConfig = createMapConfig([{ - type: 'cartodb', - options: { - sql: ` - select - t.cartodb_id, - t.the_geom, - t.the_geom_webmercator - from - test_table t, - test_table_2 t2 - where - t.cartodb_id = t2.cartodb_id - `, - cartocss: TestClient.CARTOCSS.POINTS, - cartocss_version: '2.3.0' - } - }]); + const mapConfig = createMapConfig({ + layers: [{ + type: 'cartodb', + options: { + sql: ` + select + t.cartodb_id, + t.the_geom, + t.the_geom_webmercator + from + test_table t, + test_table_2 t2 + where + t.cartodb_id = t2.cartodb_id + `, + cartocss: TestClient.CARTOCSS.POINTS, + cartocss_version: '2.3.0' + } + }] + }); const testClient = new TestClient(mapConfig);