Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
criamico committed Nov 3, 2021
1 parent 5fe3eaa commit 565251b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function (providerContext: FtrProviderContext) {
.post(`/api/fleet/package_policies`)
.set('kbn-xsrf', 'xxxx')
.send({
name: 'filetest-1',
name: 'filetest',
description: '',
namespace: 'default',
policy_id: hostedPolicy.id,
Expand All @@ -85,7 +85,7 @@ export default function (providerContext: FtrProviderContext) {

expect(responseWithoutForce.statusCode).to.be(400);
expect(responseWithoutForce.message).to.contain(
'Cannot add integrations to hosted agent policy'
'Cannot update integrations of hosted agent policy'
);

// try same request with `force: true`
Expand Down Expand Up @@ -122,7 +122,7 @@ export default function (providerContext: FtrProviderContext) {
.post(`/api/fleet/package_policies`)
.set('kbn-xsrf', 'xxxx')
.send({
name: 'filetest-1',
name: 'filetest-2',
description: '',
namespace: 'default',
policy_id: agentPolicyId,
Expand Down Expand Up @@ -282,7 +282,7 @@ export default function (providerContext: FtrProviderContext) {
.post(`/api/fleet/agent_policies`)
.set('kbn-xsrf', 'xxxx')
.send({
name: 'Test policy',
name: 'Test policy 2',
namespace: 'default',
});
const otherAgentPolicyId = agentPolicyResponse.item.id;
Expand Down
10 changes: 5 additions & 5 deletions x-pack/test/fleet_api_integration/apis/package_policy/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default function (providerContext: FtrProviderContext) {
});
});

it('should return a 500 if there is another package policy with the same name', async function () {
it('should return a 400 if there is another package policy with the same name', async function () {
await supertest
.put(`/api/fleet/package_policies/${packagePolicyId2}`)
.set('kbn-xsrf', 'xxxx')
Expand All @@ -176,15 +176,15 @@ export default function (providerContext: FtrProviderContext) {
version: '0.1.0',
},
})
.expect(500);
.expect(400);
});

it('should return a 500 if there is another package policy with the same name on a different policy', async function () {
it('should return a 400 if there is another package policy with the same name on a different policy', async function () {
const { body: agentPolicyResponse } = await supertest
.post(`/api/fleet/agent_policies`)
.set('kbn-xsrf', 'xxxx')
.send({
name: 'Test policy',
name: 'Test policy 2',
namespace: 'default',
});
const otherAgentPolicyId = agentPolicyResponse.item.id;
Expand All @@ -206,7 +206,7 @@ export default function (providerContext: FtrProviderContext) {
version: '0.1.0',
},
})
.expect(500);
.expect(400);
});

it('should work with frozen input vars', async function () {
Expand Down

0 comments on commit 565251b

Please sign in to comment.