Update Note E2E tests to use new getNoteDtoByIdOrAlias method

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-09-22 17:53:17 +02:00
parent 5d1cc6c339
commit 8145fc48d1
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -27,7 +27,8 @@ describe('Notes', () => {
.expect(201); .expect(201);
expect(response.body.metadata?.id).toBeDefined(); expect(response.body.metadata?.id).toBeDefined();
expect( expect(
notesService.getNoteByIdOrAlias(response.body.metadata.id).content, (await notesService.getNoteDtoByIdOrAlias(response.body.metadata.id))
.content,
).toEqual(newNote); ).toEqual(newNote);
}); });
@ -49,7 +50,8 @@ describe('Notes', () => {
.expect(201); .expect(201);
expect(response.body.metadata?.id).toBeDefined(); expect(response.body.metadata?.id).toBeDefined();
return expect( return expect(
notesService.getNoteByIdOrAlias(response.body.metadata.id).content, (await notesService.getNoteDtoByIdOrAlias(response.body.metadata.id))
.content,
).toEqual(newNote); ).toEqual(newNote);
}); });
@ -67,9 +69,9 @@ describe('Notes', () => {
.put('/notes/test4') .put('/notes/test4')
.send('New note text') .send('New note text')
.expect(200); .expect(200);
return expect(notesService.getNoteByIdOrAlias('test4').content).toEqual( return expect(
'New note text', (await notesService.getNoteDtoByIdOrAlias('test4')).content,
); ).toEqual('New note text');
}); });
it.skip(`PUT /notes/{note}/metadata`, () => { it.skip(`PUT /notes/{note}/metadata`, () => {