diff --git a/x-pack/plugins/maps/server/mvt/__tests__/pbf/0_0_0_grid_asgrid.pbf b/x-pack/plugins/maps/server/mvt/__tests__/pbf/0_0_0_grid_asgrid.pbf new file mode 100644 index 0000000000000..f2289865b8022 Binary files /dev/null and b/x-pack/plugins/maps/server/mvt/__tests__/pbf/0_0_0_grid_asgrid.pbf differ diff --git a/x-pack/plugins/maps/server/mvt/__tests__/pbf/0_0_0_grid.pbf b/x-pack/plugins/maps/server/mvt/__tests__/pbf/0_0_0_grid_aspoint.pbf similarity index 100% rename from x-pack/plugins/maps/server/mvt/__tests__/pbf/0_0_0_grid.pbf rename to x-pack/plugins/maps/server/mvt/__tests__/pbf/0_0_0_grid_aspoint.pbf diff --git a/x-pack/plugins/maps/server/mvt/get_tile.test.ts b/x-pack/plugins/maps/server/mvt/get_tile.test.ts index caa4978aff31f..76c1741ab2ad0 100644 --- a/x-pack/plugins/maps/server/mvt/get_tile.test.ts +++ b/x-pack/plugins/maps/server/mvt/get_tile.test.ts @@ -93,29 +93,34 @@ describe('getGridTile', () => { beforeEach(() => { mockCallElasticsearch.mockReset(); - }); - - test('0.0.0 tile (clusters)', async () => { mockCallElasticsearch.mockImplementation((type) => { return TILE_GRIDAGGS['0.0.0'].gridAggResponse; }); + }); - const tile = await getGridTile({ - x: 0, - y: 0, - z: 0, - index: 'manhattan', - requestBody, - geometryFieldName, - logger: ({ - info: () => {}, - } as unknown) as Logger, - callElasticsearch: mockCallElasticsearch, - requestType: RENDER_AS.POINT, - geoFieldType: ES_GEO_FIELD_TYPE.GEO_POINT, - }); + const defaultParams = { + x: 0, + y: 0, + z: 0, + index: 'manhattan', + requestBody, + geometryFieldName, + logger: ({ + info: () => {}, + } as unknown) as Logger, + callElasticsearch: mockCallElasticsearch, + requestType: RENDER_AS.POINT, + geoFieldType: ES_GEO_FIELD_TYPE.GEO_POINT, + }; + + test('0.0.0 tile (clusters)', async () => { + const tile = await getGridTile(defaultParams); + compareTiles('./__tests__/pbf/0_0_0_grid_aspoint.pbf', tile); + }); - compareTiles('./__tests__/pbf/0_0_0_grid.pbf', tile); + test('0.0.0 tile (grids)', async () => { + const tile = await getGridTile({ ...defaultParams, requestType: RENDER_AS.GRID }); + compareTiles('./__tests__/pbf/0_0_0_grid_asgrid.pbf', tile); }); });