test(public-api): fix test for get note metadata call

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-08-21 20:07:22 +02:00 committed by David Mehren
parent 6293bf72b2
commit b81761fcd0

View file

@ -316,6 +316,8 @@ describe('Notes', () => {
);
// save the creation time
const createDate = note.createdAt;
const revisions = await note.revisions;
const updatedDate = revisions[revisions.length - 1].createdAt;
// wait one second
await new Promise((r) => setTimeout(r, 1000));
// update the note
@ -324,7 +326,7 @@ describe('Notes', () => {
.get('/api/v2/notes/test5a/metadata')
.expect(200);
expect(metadata.body.createdAt).toEqual(createDate.toISOString());
expect(metadata.body.updateTime).not.toEqual(createDate.toISOString());
expect(metadata.body.updatedAt).not.toEqual(updatedDate.toISOString());
});
});