Skip to content

Commit

Permalink
add functional test (tbd)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Oct 6, 2020
1 parent d5fc9ab commit 4bd8d11
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions x-pack/test/api_integration/apis/maps/proxy_api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import expect from '@kbn/expect';

export default function ({ getService }) {
const supertest = getService('supertest');

describe('EMS proxy', () => {
it('should correctly rewrite url and format', async () => {
const resp = await supertest
.get(`/api/maps/ems/files/v7.10/manifest`)
.set('kbn-xsrf', 'kibana')
.expect(200);

expect(resp.body.layers.length).to.be(66);

//Check world-layer
const worldLayer = resp.body.layers.find((layer) => layer.layer_id === 'world_countries');
expect(worldLayer.formats.length).to.be(1);
expect(worldLayer.formats[0].type).to.be('geojson');
expect(worldLayer.formats[0].url).to.be('file?id=world_countries');
});
});
}

0 comments on commit 4bd8d11

Please sign in to comment.