Skip to content

Commit

Permalink
test for not deleting draft submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ktuite committed Sep 13, 2024
1 parent 76e523b commit 9eb00f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 12 additions & 0 deletions test/integration/api/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,18 @@ describe('api: /forms/:id/submissions', () => {
.expect(200))
.then(() => asAlice.get('/v1/projects/1/forms/simple/submissions/one')
.expect(404)))));

it('should not let a draft submission be deleted', testService(async (service) => {
const asAlice = await service.login('alice');
await asAlice.post('/v1/projects/1/forms/simple/draft');
await asAlice.post('/v1/projects/1/forms/simple/draft/submissions')
.send(testData.instances.simple.one)
.set('Content-Type', 'application/xml')
.expect(200);
// draft submission delete resource does not exist
await asAlice.delete('/v1/projects/1/forms/simple/draft/submissions/one')
.expect(404);
}));
});

describe('/:instanceId RESTORE', () => {
Expand Down
3 changes: 0 additions & 3 deletions test/integration/other/submission-purging.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,4 @@ describe('query module submission purge', () => {
});
}));
});

// TODO
// should not delete a draft submission? or yes?
});

0 comments on commit 9eb00f4

Please sign in to comment.