From 3bde256d62fdb6a64656a4067f7a1f9da6043c1e Mon Sep 17 00:00:00 2001 From: Sanghoon Kim <20144277+kim-sanghoon@users.noreply.github.com> Date: Wed, 1 Dec 2021 10:17:10 +0900 Subject: [PATCH] Modify the unit test for changing maxLevel --- test/modules/tilesource.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/modules/tilesource.js b/test/modules/tilesource.js index 16fbb292..2f752c4a 100644 --- a/test/modules/tilesource.js +++ b/test/modules/tilesource.js @@ -128,8 +128,6 @@ assert.equal(tileSource.maxLevel, 12, 'The initial max level should be 12.'); - tileSource.maxLevel = 9; - function assertLevelScale(level, expected) { var actual = tileSource.getLevelScale(level); assert.ok(Math.abs(actual - expected) < Number.EPSILON, "The scale at level " + level + @@ -141,6 +139,13 @@ assertLevelScale(10, 1 / 4); assertLevelScale(8, 1 / 16); assertLevelScale(6, 1 / 64); + + tileSource.setMaxLevel(9); + + assertLevelScale(9, 1); + assertLevelScale(7, 1 / 4); + assertLevelScale(5, 1 / 16); + assertLevelScale(3, 1 / 64); }); }());