Skip to content

Commit

Permalink
Fix bug and test
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Jan 23, 2025
1 parent 494e676 commit 8e8d4d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class AgentPolicyService {
soClient,
agentPolicy,
existingAgentPolicy,
getAllowedOutputTypesForAgentPolicy(existingAgentPolicy)
getAllowedOutputTypesForAgentPolicy({ ...existingAgentPolicy, ...agentPolicy })
);
}
await soClient.update<AgentPolicySOAttributes>(savedObjectType, id, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,6 @@ export default function (providerContext: FtrProviderContext) {
});

it('should return 400 if setting data output to non-local ES for agentless policy', async () => {
const { body: fleetServerHosts } = await supertest
.get(`/api/fleet/fleet_server_hosts`)
.expect(200);
// eslint-disable-next-line no-console
console.log(fleetServerHosts);

const { body: outputResponse } = await supertest
.post(`/api/fleet/outputs`)
.set('kbn-xsrf', 'xxxx')
Expand Down Expand Up @@ -1669,12 +1663,6 @@ export default function (providerContext: FtrProviderContext) {
});

it('should return 400 if updating data output to non-local ES for agentless policy', async () => {
const { body: fleetServerHosts } = await supertest
.get(`/api/fleet/fleet_server_hosts`)
.expect(200);
// eslint-disable-next-line no-console
console.log(fleetServerHosts);

const { body: outputResponse } = await supertest
.post(`/api/fleet/outputs`)
.set('kbn-xsrf', 'xxxx')
Expand All @@ -1696,12 +1684,8 @@ export default function (providerContext: FtrProviderContext) {
.send({
name: 'test-agentless-policy',
namespace: 'default',
supports_agentless: true,
});

// .expect(200);
// eslint-disable-next-line no-console
console.log(agentPolicyResponse);
})
.expect(200);

const agentPolicy = agentPolicyResponse.body.item;

Expand All @@ -1711,6 +1695,7 @@ export default function (providerContext: FtrProviderContext) {
.send({
name: 'test-agentless-policy',
namespace: 'default',
supports_agentless: true,
data_output_id: outputResponse.item.id,
})
.expect(400);
Expand Down

0 comments on commit 8e8d4d9

Please sign in to comment.