Skip to content

Commit

Permalink
add api integration test for indexSettings route
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Dec 26, 2019
1 parent c1e6ced commit 1072d23
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
14 changes: 12 additions & 2 deletions x-pack/test/api_integration/apis/maps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@
* you may not use this file except in compliance with the Elastic License.
*/

export default function({ loadTestFile }) {
export default function({ loadTestFile, getService }) {
const esArchiver = getService('esArchiver');

describe('Maps endpoints', () => {
loadTestFile(require.resolve('./migrations'));
before(async () => {
await esArchiver.loadIfNeeded('logstash_functional');
});

describe('', () => {
const esArchiver = getService('esArchiver');
loadTestFile(require.resolve('./index_settings'));
loadTestFile(require.resolve('./migrations'));
});
});
}
23 changes: 23 additions & 0 deletions x-pack/test/api_integration/apis/maps/index_settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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('index settings', () => {
it('should return index settings', async () => {
const resp = await supertest
.get(`/api/maps/indexSettings?indexPatternTitle=logstash*`)
.set('kbn-xsrf', 'kibana')
.expect(200);

expect(resp.body.maxResultWindow).to.be(10000);
expect(resp.body.maxInnerResultWindow).to.be(100);
});
});
}

0 comments on commit 1072d23

Please sign in to comment.