From c9e0f330c0e3771594355235ba5143c9005d38a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 29 Nov 2017 16:15:52 +0100 Subject: [PATCH] Add test to check incompatible layers --- test/acceptance/mvt.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/acceptance/mvt.js b/test/acceptance/mvt.js index 0c566006..25e32308 100644 --- a/test/acceptance/mvt.js +++ b/test/acceptance/mvt.js @@ -181,6 +181,38 @@ return function () { done(); }); }); + + it('should fail when the map-config mix layers with and without cartocss', function (done) { + const response = { + status: 400, + headers: { + 'Content-Type': 'application/json; charset=utf-8' + } + }; + + this.testClient.mapConfig.layers[0].options.cartocss = '#layer0 { marker-fill: red; marker-width: 10; }'; + this.testClient.mapConfig.layers[0].options.cartocss_version = '2.3.0'; + this.testClient.getLayergroup(response, (err, body) => { + if (err) { + return done(err); + } + + assert.deepEqual(body, { + "errors": [ + "The layergroup contains incompatible layers: don't mix styled layers with non styled layers (without cartocss)" + ], + "errors_with_context":[ + { + "type":"layergroup", + "message": "The layergroup contains incompatible layers: don't mix styled layers with non styled layers (without cartocss)" + } + ] + }); + + done(); + }); + }); + }); describe('analysis-layers-dataviews-mvt', function () {