Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ export function registerAPIRoutes({
}
return res.badRequest(e.message);
}

return res.created({ body: result });
return res.ok({ body: result });
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ const updatedDashboard = {
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
describe('main', () => {
it('should return 201 with an updated dashboard', async () => {
it('should return 200 with an updated dashboard', async () => {
const response = await supertest
.put(`${PUBLIC_API_PATH}/be3733a0-9efe-11e7-acb3-3dab96693fab`)
.set('kbn-xsrf', 'true')
.set('ELASTIC_HTTP_VERSION_HEADER', '2023-10-31')
.send(updatedDashboard);

expect(response.status).to.be(201);
expect(response.status).to.be(200);

expect(response.body.item.id).to.be('be3733a0-9efe-11e7-acb3-3dab96693fab');
expect(response.body.item.type).to.be('dashboard');
Expand Down Expand Up @@ -88,7 +88,7 @@ export default function ({ getService }: FtrProviderContext) {
},
});

expect(response.status).to.be(201);
expect(response.status).to.be(200);
expect(response.body.item.attributes.tags).to.contain('bar');
expect(response.body.item.attributes.tags).to.have.length(1);
const referenceIds = response.body.item.references.map(
Expand All @@ -112,7 +112,7 @@ export default function ({ getService }: FtrProviderContext) {
},
});

expect(response.status).to.be(201);
expect(response.status).to.be(200);
expect(response.body.item.attributes.tags).to.contain('foo');
expect(response.body.item.attributes.tags).to.have.length(1);
const referenceIds = response.body.item.references.map(
Expand All @@ -136,7 +136,7 @@ export default function ({ getService }: FtrProviderContext) {
},
});

expect(response.status).to.be(201);
expect(response.status).to.be(200);
expect(response.body.item.attributes).not.to.have.property('tags');
const referenceIds = response.body.item.references.map(
(ref: SavedObjectReference) => ref.id
Expand All @@ -159,7 +159,7 @@ export default function ({ getService }: FtrProviderContext) {
},
});

expect(response.status).to.be(201);
expect(response.status).to.be(200);
expect(response.body.item.attributes.tags).to.contain('foo');
expect(response.body.item.attributes.tags).to.contain('bar');
expect(response.body.item.attributes.tags).to.contain('buzz');
Expand Down