Public API: Test that forbidden notes can't be accessed

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-08-29 17:36:03 +02:00
parent 470f09d8fe
commit e65c19ddd8
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -113,6 +113,13 @@ describe('Notes', () => {
.expect('Content-Type', /json/)
.expect(404);
});
it('fails with a forbidden note id', async () => {
// check if a forbidden note correctly returns 400
await request(app.getHttpServer())
.get('/notes/forbiddenNoteId')
.expect('Content-Type', /json/)
.expect(400);
});
});
describe('POST /notes/{note}', () => {