From 2e274b936a4901af052b0592a8802107dba331e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 26 Aug 2016 15:07:06 +0200 Subject: [PATCH] Improved test to check all possible values of visibility in named maps templates --- test/acceptance/named_layers_visibility.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/acceptance/named_layers_visibility.js b/test/acceptance/named_layers_visibility.js index 2d70d26b..7243fed1 100644 --- a/test/acceptance/named_layers_visibility.js +++ b/test/acceptance/named_layers_visibility.js @@ -31,6 +31,16 @@ describe('named_layers', function() { } }; + var visibileLayer = { + type: 'cartodb', + options: { + sql: 'select 1 cartodb_id, null::geometry the_geom_webmercator', + cartocss: '#layer { marker-fill: <%= color %>; }', + cartocss_version: '2.3.0', + visibility: true, + } + }; + var notVisibileLayer = { type: 'cartodb', options: { @@ -57,6 +67,7 @@ describe('named_layers', function() { layergroup: { layers: [ wadusLayer, + visibileLayer, notVisibileLayer ] } @@ -147,9 +158,12 @@ describe('named_layers', function() { assert.ok(parsedBody.layergroupid); assert.ok(parsedBody.last_updated); - assert.equal(parsedBody.metadata.layers.length, 1); + assert.equal(parsedBody.metadata.layers.length, 2); + assert.equal(parsedBody.metadata.layers[0].id, 'layer0'); assert.equal(parsedBody.metadata.layers[0].type, 'mapnik'); + assert.equal(parsedBody.metadata.layers[1].id, 'layer1'); + assert.equal(parsedBody.metadata.layers[1].type, 'mapnik'); keysToDelete['map_cfg|' + LayergroupToken.parse(parsedBody.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5;