Skip to content

Commit

Permalink
Update tests with expectation that 204 response comes from data service
Browse files Browse the repository at this point in the history
which is, or should be, what is sent #1985
  • Loading branch information
iamleeg committed Jul 8, 2021
1 parent fdbcccd commit 8530f39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions verification/curator-service/api/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ paths:
$ref: '#/components/responses/200ParsersArray'
'500':
$ref: '#/components/responses/500'
/api/sources/{sourceId}/markPendingRemoval:
/sources/{sourceId}/markPendingRemoval:
parameters:
- name: sourceId
in: path
Expand All @@ -385,7 +385,7 @@ paths:
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
/api/sources/{sourceId}/removePendingCases:
/sources/{sourceId}/removePendingCases:
parameters:
- name: sourceId
in: path
Expand All @@ -409,7 +409,7 @@ paths:
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
/api/sources/{sourceId}/clearPendingRemovalStatus:
/sources/{sourceId}/clearPendingRemovalStatus:
parameters:
- name: sourceId
in: path
Expand Down
12 changes: 6 additions & 6 deletions verification/curator-service/api/test/sources.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ describe('marking sources for deletion', () => {

it('forwards request to mark sources to the data service', async () => {
mockedAxios.post.mockResolvedValueOnce({
status: 201,
status: 204,
});
const source = await new Source({
name: 'test-source',
Expand All @@ -650,7 +650,7 @@ describe('marking sources for deletion', () => {
}).save();
await curatorRequest
.post(`/api/sources/${source._id}/markPendingRemoval`)
.expect(201);
.expect(204);
const expectedEmail = encodeURIComponent(baseUser.email);
expect(mockedAxios.post).toHaveBeenCalledWith(
`http://localhost:3000/api/cases/markPendingRemoval?sourceId=${source._id}&email=${expectedEmail}`,
Expand All @@ -675,7 +675,7 @@ describe('clearing pending-deletion flag', () => {

it('forwards request to clear mark to the data service', async () => {
mockedAxios.post.mockResolvedValueOnce({
status: 201,
status: 204,
});
const source = await new Source({
name: 'test-source',
Expand All @@ -686,7 +686,7 @@ describe('clearing pending-deletion flag', () => {
}).save();
await curatorRequest
.post(`/api/sources/${source._id}/clearPendingRemovalStatus`)
.expect(201);
.expect(204);
const expectedEmail = encodeURIComponent(baseUser.email);
expect(mockedAxios.post).toHaveBeenCalledWith(
`http://localhost:3000/api/cases/clearPendingRemovalStatus?sourceId=${source._id}&email=${expectedEmail}`,
Expand All @@ -711,7 +711,7 @@ describe('deleting pending cases for a source', () => {

it('forwards request to remove cases to the data service', async () => {
mockedAxios.post.mockResolvedValueOnce({
status: 201,
status: 204,
});
const source = await new Source({
name: 'test-source',
Expand All @@ -722,7 +722,7 @@ describe('deleting pending cases for a source', () => {
}).save();
await curatorRequest
.post(`/api/sources/${source._id}/removePendingCases`)
.expect(201);
.expect(204);
expect(mockedAxios.post).toHaveBeenCalledWith(
`http://localhost:3000/api/cases/removePendingCases?sourceId=${source._id}`,
);
Expand Down

0 comments on commit 8530f39

Please sign in to comment.