Fix tests to use map-config builder properly

This commit is contained in:
Daniel García Aubert 2019-07-09 14:47:40 +02:00
parent c066e2c3cf
commit ef39f23d1f

View File

@ -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([{
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([{
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,7 +86,8 @@ 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([{
const mapConfig = createMapConfig({
layers: [{
type: 'cartodb',
options: {
sql: `
@ -99,7 +104,8 @@ describe('cache-control header', function () {
cartocss: TestClient.CARTOCSS.POINTS,
cartocss_version: '2.3.0'
}
}]);
}]
});
const testClient = new TestClient(mapConfig);