Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed May 16, 2022
1 parent c38aee0 commit 9d28e56
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions x-pack/test/fleet_api_integration/apis/agents/current_upgrades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export default function (providerContext: FtrProviderContext) {

describe('GET /api/fleet/agents/current_upgrades', () => {
before(async () => {
await es.deleteByQuery({
index: AGENT_ACTIONS_INDEX,
q: '*',
});
// Action 1 non expired and non complete
await es.index({
refresh: 'wait_for',
Expand Down Expand Up @@ -74,7 +78,7 @@ export default function (providerContext: FtrProviderContext) {
document: {
type: 'UPGRADE',
action_id: 'action3',
agents: ['agent1', 'agent2', 'agent3'],
agents: ['agent1', 'agent2'],
expiration: moment().add(1, 'day').toISOString(),
},
});
Expand Down Expand Up @@ -143,17 +147,6 @@ export default function (providerContext: FtrProviderContext) {
});
});
it('should respond 200 and the current upgrades', async () => {
// const kibanaVersion = await kibanaServer.version.get();
// await es.update({
// id: 'agent1',
// refresh: 'wait_for',
// index: AGENTS_INDEX,
// body: {
// doc: {
// local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } },
// },
// },
// });
const res = await supertest.get(`/api/fleet/agents/current_upgrades`).expect(200);
const actionIds = res.body.items.map((item: any) => item.actionId);
expect(actionIds).length(2);
Expand Down

0 comments on commit 9d28e56

Please sign in to comment.