Skip to content

Commit

Permalink
test empty geojson tile
Browse files Browse the repository at this point in the history
  • Loading branch information
Molly Lloyd committed Jun 7, 2017
1 parent 43cfb22 commit 2a2d2ab
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/unit/source/tile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ test('querySourceFeatures', (t) => {
t.end();
});

t.test('empty geojson tile', (t) => {
const tile = new Tile(new TileCoord(1, 1, 1));
let result;

result = [];
tile.querySourceFeatures(result, {});
t.equal(result.length, 0);

const geojsonWrapper = new GeoJSONWrapper([]);
geojsonWrapper.name = '_geojsonTileLayer';
tile.rawTileData = vtpbf({ layers: { '_geojsonTileLayer': geojsonWrapper }});
result = [];
t.doesNotThrow(tile.querySourceFeatures(result));
t.equal(result.length, 0);
t.end();
});

t.test('vector tile', (t) => {
const tile = new Tile(new TileCoord(1, 1, 1));
let result;
Expand Down

0 comments on commit 2a2d2ab

Please sign in to comment.