Skip to content

Commit f09e7b0

Browse files
more unit tests
1 parent 6db0ad3 commit f09e7b0

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed
91 Bytes
Binary file not shown.

x-pack/plugins/maps/server/mvt/get_tile.test.ts

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,34 @@ describe('getGridTile', () => {
9393

9494
beforeEach(() => {
9595
mockCallElasticsearch.mockReset();
96-
});
97-
98-
test('0.0.0 tile (clusters)', async () => {
9996
mockCallElasticsearch.mockImplementation((type) => {
10097
return TILE_GRIDAGGS['0.0.0'].gridAggResponse;
10198
});
99+
});
102100

103-
const tile = await getGridTile({
104-
x: 0,
105-
y: 0,
106-
z: 0,
107-
index: 'manhattan',
108-
requestBody,
109-
geometryFieldName,
110-
logger: ({
111-
info: () => {},
112-
} as unknown) as Logger,
113-
callElasticsearch: mockCallElasticsearch,
114-
requestType: RENDER_AS.POINT,
115-
geoFieldType: ES_GEO_FIELD_TYPE.GEO_POINT,
116-
});
101+
const defaultParams = {
102+
x: 0,
103+
y: 0,
104+
z: 0,
105+
index: 'manhattan',
106+
requestBody,
107+
geometryFieldName,
108+
logger: ({
109+
info: () => {},
110+
} as unknown) as Logger,
111+
callElasticsearch: mockCallElasticsearch,
112+
requestType: RENDER_AS.POINT,
113+
geoFieldType: ES_GEO_FIELD_TYPE.GEO_POINT,
114+
};
115+
116+
test('0.0.0 tile (clusters)', async () => {
117+
const tile = await getGridTile(defaultParams);
118+
compareTiles('./__tests__/pbf/0_0_0_grid_aspoint.pbf', tile);
119+
});
117120

118-
compareTiles('./__tests__/pbf/0_0_0_grid.pbf', tile);
121+
test('0.0.0 tile (grids)', async () => {
122+
const tile = await getGridTile({ ...defaultParams, requestType: RENDER_AS.GRID });
123+
compareTiles('./__tests__/pbf/0_0_0_grid_asgrid.pbf', tile);
119124
});
120125
});
121126

0 commit comments

Comments
 (0)