Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaElastic committed Jan 18, 2024
1 parent f189ca5 commit 8724106
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
7 changes: 1 addition & 6 deletions x-pack/test/fleet_api_integration/apis/agents/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import expect from '@kbn/expect';

import { INGEST_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server';
import { API_VERSIONS } from '@kbn/fleet-plugin/common/constants';

import { AGENTS_INDEX } from '@kbn/fleet-plugin/common';
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
Expand Down Expand Up @@ -232,11 +231,7 @@ export default function ({ getService }: FtrProviderContext) {
});

it('should work with deprecated api', async () => {
await supertest
.get(`/api/fleet/agent-status`)
.set('kbn-xsrf', 'xxxx')
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
.expect(200);
await supertest.get(`/api/fleet/agent-status`).set('kbn-xsrf', 'xxxx').expect(200);
});

it('should work with adequate package privileges', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import expect from '@kbn/expect';

import { API_VERSIONS } from '@kbn/fleet-plugin/common/constants';
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
import { setupFleetAndAgents, getEsClientForAPIKey } from '../agents/services';
import { skipIfNoDockerRegistry } from '../../helpers';
Expand Down Expand Up @@ -325,7 +324,6 @@ export default function (providerContext: FtrProviderContext) {
const { body: apiResponse } = await supertest
.post(`/api/fleet/enrollment-api-keys`)
.set('kbn-xsrf', 'xxx')
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
.send({
policy_id: 'policy1',
})
Expand All @@ -334,20 +332,14 @@ export default function (providerContext: FtrProviderContext) {
});

it('should get and delete with deprecated API', async () => {
await supertest
.get(`/api/fleet/enrollment-api-keys`)
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
.set('kbn-xsrf', 'xxx')
.expect(200);
await supertest.get(`/api/fleet/enrollment-api-keys`).set('kbn-xsrf', 'xxx').expect(200);
await supertest
.get(`/api/fleet/enrollment-api-keys/${ENROLLMENT_KEY_ID}`)
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
.set('kbn-xsrf', 'xxx')
.expect(200);

await supertest
.delete(`/api/fleet/enrollment-api-keys/${keyId}`)
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
.set('kbn-xsrf', 'xxx')
.expect(200);
});
Expand Down

0 comments on commit 8724106

Please sign in to comment.