mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* update index fields API to account for removed types * adds API test
This commit is contained in:
parent
d17e1eaa2d
commit
88bb450637
3 changed files with 37 additions and 1 deletions
|
@ -24,7 +24,6 @@ export function initIndicesApi(server) {
|
|||
.then((mappings) =>
|
||||
_(mappings)
|
||||
.map('mappings')
|
||||
.map(_.values)
|
||||
.flatten()
|
||||
.map(_.keys)
|
||||
.flatten()
|
||||
|
|
|
@ -9,6 +9,7 @@ export default function ({ loadTestFile }) {
|
|||
this.tags('ciGroup6');
|
||||
|
||||
loadTestFile(require.resolve('./basic_login'));
|
||||
loadTestFile(require.resolve('./index_fields'));
|
||||
loadTestFile(require.resolve('./roles'));
|
||||
loadTestFile(require.resolve('./privileges'));
|
||||
});
|
||||
|
|
36
x-pack/test/api_integration/apis/security/index_fields.ts
Normal file
36
x-pack/test/api_integration/apis/security/index_fields.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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/expect.js';
|
||||
import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers';
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function({ getService }: KibanaFunctionalTestDefaultProviders) {
|
||||
const supertest = getService('supertest');
|
||||
|
||||
describe('Index Fields', () => {
|
||||
describe('GET /api/security/v1/fields/{query}', () => {
|
||||
it('should return a list of available index mapping fields', async () => {
|
||||
await supertest
|
||||
.get('/api/security/v1/fields/.kibana')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send()
|
||||
.expect(200)
|
||||
.then((response: Record<string, any>) => {
|
||||
const sampleOfExpectedFields = [
|
||||
'type',
|
||||
'visualization.title',
|
||||
'dashboard.title',
|
||||
'search.columns',
|
||||
'space.name',
|
||||
];
|
||||
|
||||
sampleOfExpectedFields.forEach(field => expect(response.body).to.contain(field));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue