kibana/test/api_integration/apis/custom_integration/integrations.ts
Thomas Neirynck a565eaa39d
[Fleet] Show beats replacements in integration browser (#113291)
Display both beats and epr-packages in the integration browser. When there is overlap, the EPR-package equivalent is displayed. When the EPR-package is not yet ga, the beat-equivalent is displayed.
2021-10-01 08:11:25 -04:00

44 lines
1.7 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
describe('customIntegrations', () => {
describe('get list of append integrations', () => {
it('should return list of custom integrations that can be appended', async () => {
const resp = await supertest
.get(`/internal/customIntegrations/appendCustomIntegrations`)
.set('kbn-xsrf', 'kibana')
.expect(200);
expect(resp.body).to.be.an('array');
expect(resp.body.length).to.be.above(2); // Should at least have registered the three sample data-sets
['flights', 'logs', 'ecommerce'].forEach((sampleData) => {
expect(resp.body.findIndex((c: { id: string }) => c.id === sampleData)).to.be.above(-1);
});
});
});
describe('get list of replacement integrations', () => {
it('should return list of custom integrations that can be used to replace EPR packages', async () => {
const resp = await supertest
.get(`/internal/customIntegrations/replacementCustomIntegrations`)
.set('kbn-xsrf', 'kibana')
.expect(200);
expect(resp.body).to.be.an('array');
expect(resp.body.length).to.be.above(2); // Should have at least a few beats registered
});
});
});
}