Note E2E tests: Use the correct revision-id when checking GET /notes/{note}/revisions/{revision-id}

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-09-22 21:45:56 +02:00
parent 6e4893d179
commit c5842d69e1
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -122,9 +122,10 @@ describe('Notes', () => {
}); });
it(`GET /notes/{note}/revisions/{revision-id}`, async () => { it(`GET /notes/{note}/revisions/{revision-id}`, async () => {
await notesService.createNote('This is a test note.', 'test8'); const note = await notesService.createNote('This is a test note.', 'test8');
const revision = await notesService.getLastRevision(note);
const response = await request(app.getHttpServer()) const response = await request(app.getHttpServer())
.get('/notes/test8/revisions/1') .get('/notes/test8/revisions/' + revision.id)
.expect('Content-Type', /json/) .expect('Content-Type', /json/)
.expect(200); .expect(200);
expect(response.body.content).toEqual('This is a test note.'); expect(response.body.content).toEqual('This is a test note.');