From bf3e311b5792da1b3a0e5b5d22f2e7bc0dafd3da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 26 Aug 2016 14:46:23 +0200 Subject: [PATCH] Avoid unnecessary complexity --- test/acceptance/named_layers_visibility.js | 39 ++++++++-------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/test/acceptance/named_layers_visibility.js b/test/acceptance/named_layers_visibility.js index 43dc4a77..2d70d26b 100644 --- a/test/acceptance/named_layers_visibility.js +++ b/test/acceptance/named_layers_visibility.js @@ -31,6 +31,15 @@ describe('named_layers', function() { } }; + var notVisibileLayer = { + type: 'cartodb', + options: { + sql: 'select 1 cartodb_id, null::geometry the_geom_webmercator', + cartocss: '#layer { marker-fill: <%= color %>; }', + cartocss_version: '2.3.0', + visibility: false + } + }; var templateName = 'valid_template'; var template = { @@ -48,7 +57,7 @@ describe('named_layers', function() { layergroup: { layers: [ wadusLayer, - wadusLayer + notVisibileLayer ] } }; @@ -62,17 +71,6 @@ describe('named_layers', function() { } }; - var notVisibileLayer = { - type: 'cartodb', - options: { - sql: 'select 1 cartodb_id, null::geometry the_geom_webmercator', - cartocss: '#layer { marker-fill: <%= color %>; }', - cartocss_version: '2.3.0', - visibility: false - } - }; - - var keysToDelete; beforeEach(function() { @@ -108,18 +106,7 @@ describe('named_layers', function() { method: 'open' }, layergroup: { - layers: [ - namedMapLayer, - { - type: 'mapnik', - options: { - sql: 'select * from test_table_private_1', - cartocss: '#layer { marker-fill: #cc3300; }', - cartocss_version: '2.3.0' - } - }, - notVisibileLayer - ] + layers: [ namedMapLayer ] } }; @@ -156,11 +143,13 @@ describe('named_layers', function() { } var parsedBody = JSON.parse(response.body); + assert.ok(parsedBody.layergroupid); assert.ok(parsedBody.last_updated); + assert.equal(parsedBody.metadata.layers.length, 1); + assert.equal(parsedBody.metadata.layers[0].id, 'layer0'); assert.equal(parsedBody.metadata.layers[0].type, 'mapnik'); - assert.equal(parsedBody.metadata.layers[1].type, 'mapnik'); keysToDelete['map_cfg|' + LayergroupToken.parse(parsedBody.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5;