From 330f8f3cb514f5494159694c9a4dcd2caf2c4a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 29 Nov 2017 14:10:56 +0100 Subject: [PATCH] Test invalid format for vector layergroup --- test/acceptance/mvt.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/acceptance/mvt.js b/test/acceptance/mvt.js index c1958ca5..556f0638 100644 --- a/test/acceptance/mvt.js +++ b/test/acceptance/mvt.js @@ -150,6 +150,37 @@ return function () { done(); }); }); + + it.only('should fail when the format requested is not mvt', function (done) { + const options = { + format: 'png', + response: { + status: 400, + headers: { + 'Content-Type': 'application/json; charset=utf-8' + } + } + }; + + this.testClient.getTile(0, 0, 0, options, (err, res, body) => { + if (err) { + return done(err); + } + + assert.deepEqual(body, { + "errors": [ + "Invalid format: only mvt format is available for layers without CartoCSS defined" + ], + "errors_with_context":[ + { + "type":"tile", + "message":"Invalid format: only mvt format is available for layers without CartoCSS defined" + } + ] + }); + done(); + }); + }); }); describe('analysis-layers-dataviews-mvt', function () {