Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Oct 21, 2020
1 parent 28f52b6 commit 3096a06
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class AgentPolicyService {
) {
// If Agents is not setup skip the creation of POLICY_CHANGE agent actions
// the action will be created during the fleet setup
if (!isAgentsSetup(soClient)) {
if (!(await isAgentsSetup(soClient))) {
return;
}
const policy = await agentPolicyService.getFullAgentPolicy(soClient, agentPolicyId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ export default function (providerContext: FtrProviderContext) {
});
createdAgentPolicyIds.push(testPolicyRes.item.id);

const beforeRes = await esClient.search({
index: '.kibana',
body: {
query: {
bool: {
must: [
{
terms: {
type: ['fleet-agent-actions'],
},
},
{ match: { 'fleet-agent-actions.policy_id': testPolicyRes.item.id } },
],
},
},
},
});

await supertest
.put(`/api/fleet/settings`)
.set('kbn-xsrf', 'xxxx')
Expand All @@ -105,7 +123,7 @@ export default function (providerContext: FtrProviderContext) {
},
});

expect(res.hits.hits.length).equal(2);
expect(res.hits.hits.length).equal(beforeRes.hits.hits.length + 1);
});
});
}

0 comments on commit 3096a06

Please sign in to comment.