Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/integration/layers/layersManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,25 @@ describe('layerManager', () => {
expect(response.body).toHaveProperty('cache.region', 'us-east-1');
});

it('Happy Path - should return status 200 and the whole Cache of a geopackage Cache', async () => {
const response = await requestSender.getLayersCache('gpkgExists', 'geopackage');

expect(response.status).toBe(httpStatusCodes.OK);
expect(response).toSatisfyApiSpec();
expect(response.body).toEqual({
cacheName: 'gpkgExists',
sources: [],
grids: ['epsg4326dir'],
format: 'image/png',
// eslint-disable-next-line @typescript-eslint/naming-convention
upscale_tiles: 18,
// eslint-disable-next-line @typescript-eslint/naming-convention
minimize_meta_requests: true,
// eslint-disable-next-line @typescript-eslint/naming-convention
cache: { type: 'geopackage', filename: '/path/to/tiles/directory/gpkgExists.gpkg', table_name: 'gpkgExists' },
});
});

it('Sad Path - should fail with response status 404 Not Found and layer name is not exists', async () => {
const mockLayerName = 'mockLayerNameIsNotExists';
const response = await requestSender.getLayersCache(mockLayerName, 's3');
Expand Down
17 changes: 17 additions & 0 deletions tests/unit/mock/mockJson.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
"default_ttl": 86400
}
},
"gpkgExists": {
"sources": [],
"grids": ["epsg4326dir"],
"format": "image/png",
"upscale_tiles": 18,
"minimize_meta_requests": true,
"cache": {
"type": "geopackage",
"filename": "/path/to/tiles/directory/gpkgExists.gpkg",
"table_name": "gpkgExists"
}
},
"redisExists": {
"sources": [],
"grids": ["epsg4326dir"],
Expand Down Expand Up @@ -97,6 +109,11 @@
"title": "title",
"sources": ["source"]
},
{
"name": "gpkgExists",
"title": "title",
"sources": ["gpkgExists"]
},
{
"name": "redisExists",
"title": "redisExists-redis",
Expand Down
Loading