From 13955aebe57986e36cd64c03fbab94e69aaa2b89 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sat, 20 Feb 2021 16:10:30 +0100 Subject: [PATCH] NotesE2ETests: Ensure posting the same note alias twice fails Signed-off-by: Philip Molares --- test/public-api/notes.e2e-spec.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/public-api/notes.e2e-spec.ts b/test/public-api/notes.e2e-spec.ts index dda8ef9da..3492ff6d3 100644 --- a/test/public-api/notes.e2e-spec.ts +++ b/test/public-api/notes.e2e-spec.ts @@ -114,6 +114,15 @@ describe('Notes', () => { ), ).toEqual(content); }); + + it('fails with a existing alias', async () => { + await request(app.getHttpServer()) + .post('/notes/test2') + .set('Content-Type', 'text/markdown') + .send(content) + .expect('Content-Type', /json/) + .expect(400); + }); }); describe('DELETE /notes/{note}', () => {