From b8589acc6e01092cbf85048e350da25c1562c42e Mon Sep 17 00:00:00 2001 From: Lasse Laakkonen Date: Thu, 19 Oct 2017 17:54:46 +0300 Subject: [PATCH] Add test for initializing Zoomify source with custom tile size. --- test/spec/ol/source/zoomify.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/spec/ol/source/zoomify.test.js b/test/spec/ol/source/zoomify.test.js index cb39adab88..4b202e0164 100644 --- a/test/spec/ol/source/zoomify.test.js +++ b/test/spec/ol/source/zoomify.test.js @@ -1,5 +1,6 @@ +goog.require('ol'); goog.require('ol.dom'); goog.require('ol.events'); goog.require('ol.proj.Projection'); @@ -30,6 +31,13 @@ describe('ol.source.Zoomify', function() { size: size }); } + function getZoomifySourceWith1024pxTiles() { + return new ol.source.Zoomify({ + url: zoomifyUrl, + size: size, + tileSize: 1024 + }); + } describe('constructor', function() { @@ -148,6 +156,14 @@ describe('ol.source.Zoomify', function() { } }); + it('has expected tileSize', function() { + var sources = [getZoomifySource(), getZoomifySourceWith1024pxTiles()]; + var expectedTileSizes = [ol.DEFAULT_TILE_SIZE, 1024]; + for (var i = 0; i < sources.length; i++) { + var tileGrid = sources[i].getTileGrid(); + expect(tileGrid.getTileSize()).to.eql(expectedTileSizes[i]); + } + }); }); describe('tierSizeCalculation configuration', function() {