From e9112da3053adcd10b05c2c0a0935a057377381d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 18 May 2017 15:41:41 +0200 Subject: [PATCH] Going red: add test to check undefined buffersize in requested mapconfig throws error --- test/acceptance/buffer-size-format.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/acceptance/buffer-size-format.js b/test/acceptance/buffer-size-format.js index d5157585..15be2e66 100644 --- a/test/acceptance/buffer-size-format.js +++ b/test/acceptance/buffer-size-format.js @@ -283,7 +283,7 @@ describe('buffer size per format for named maps', function () { }); -describe('buffer size per format for named maps w/o placeholders', function () { +describe.only('buffer size per format for named maps w/o placeholders', function () { var testCases = [ { desc: 'should get png tile using buffer-size 0 overriden by template params', @@ -396,7 +396,23 @@ describe('buffer size per format for named maps w/o placeholders', function () { assert: function (tile, callback) { assert.utfgridEqualsFile(tile, this.fixturePath, 2, callback); } - } + }, + { + desc: 'should get png tile using buffer-size 0 overriden by template params with no buffersize in mapconfig', + coords: { z: 7, x: 64, y: 48 }, + format: 'png', + placeholders: { + buffersize: { + png: 0 + } + }, + fixturePath: './test/fixtures/buffer-size/tile-7.64.48-buffer-size-0.png', + template: createBufferSizeTemplate('named-no-buffer-size-mapconfig-png-0', undefined, {}), + assert: function (tile, callback) { + assert.imageIsSimilarToFile(tile, this.fixturePath, IMAGE_TOLERANCE_PER_MIL, callback); + } + }, + ]; testCases.forEach(function (test) {