NotesService: updateNoteByIdOrAlias should return the new note

Fixes #702

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-01-10 20:30:45 +01:00
parent 4a1bec8eec
commit 6301a264dd
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 4 additions and 2 deletions

View file

@ -103,7 +103,7 @@ describe('Notes', () => {
it(`PUT /notes/{note}`, async () => {
await notesService.createNote('This is a test note.', 'test4');
await request(app.getHttpServer())
const response = await request(app.getHttpServer())
.put('/notes/test4')
.set('Content-Type', 'text/markdown')
.send('New note text')
@ -111,6 +111,7 @@ describe('Notes', () => {
await expect(
(await notesService.getNoteDtoByIdOrAlias('test4')).content,
).toEqual('New note text');
expect(response.body.content).toEqual('New note text');
// check if a missing note correctly returns 404
await request(app.getHttpServer())