From 1072d2374ed6e7c2e27f520bf1e9332e92dbb79a Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Thu, 26 Dec 2019 09:11:48 -0700 Subject: [PATCH] add api integration test for indexSettings route --- .../test/api_integration/apis/maps/index.js | 14 +++++++++-- .../apis/maps/index_settings.js | 23 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 x-pack/test/api_integration/apis/maps/index_settings.js diff --git a/x-pack/test/api_integration/apis/maps/index.js b/x-pack/test/api_integration/apis/maps/index.js index d2fe97abbe5c5..e4af60416faaf 100644 --- a/x-pack/test/api_integration/apis/maps/index.js +++ b/x-pack/test/api_integration/apis/maps/index.js @@ -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')); + }); }); } diff --git a/x-pack/test/api_integration/apis/maps/index_settings.js b/x-pack/test/api_integration/apis/maps/index_settings.js new file mode 100644 index 0000000000000..eae1990587b2a --- /dev/null +++ b/x-pack/test/api_integration/apis/maps/index_settings.js @@ -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); + }); + }); +}