From 5da32dbc5b18e305ba22f6ae7a372d8fad3bc3f2 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 19 Aug 2019 11:37:06 +0200 Subject: [PATCH] More tests --- test/spec/ol/source/vectortile.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/spec/ol/source/vectortile.test.js b/test/spec/ol/source/vectortile.test.js index d1b8acbd7b..f971a2ad1f 100644 --- a/test/spec/ol/source/vectortile.test.js +++ b/test/spec/ol/source/vectortile.test.js @@ -95,6 +95,20 @@ describe('ol.source.VectorTile', function() { expect(tile.getState()).to.be(TileState.EMPTY); }); + it('creates empty tiles outside the world extent when wrapX === false', function() { + const source = new VectorTileSource({ + wrapX: false + }); + const tile = source.getTile(0, -1, 0, 1, source.getProjection()); + expect(tile.getState()).to.be(TileState.EMPTY); + }); + + it('creates non-empty tiles outside the world extent when wrapX === true', function() { + const source = new VectorTileSource({}); + const tile = source.getTile(0, -1, 0, 1, source.getProjection()); + expect(tile.getState()).to.be(TileState.IDLE); + }); + it('creates new tile when source key changes', function() { source.setKey('key1'); const tile1 = source.getTile(0, 0, 0, 1, getProjection('EPSG:3857'));