PrivateAPI: Add lastVisited to HistoryEntryImportDto

As the DTO is only for importing an existing history the lastVisited of those entries should also be posted.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-04-11 12:37:47 +02:00 committed by David Mehren
parent eeaa74b385
commit c1d706b350
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
5 changed files with 102 additions and 13 deletions

View file

@ -100,10 +100,13 @@ describe('History', () => {
});
it('POST /me/history', async () => {
expect((await historyService.getEntriesByUser(user)).length).toEqual(1);
const pinStatus = true;
const lastVisited = new Date('2020-12-01 12:23:34');
const postEntryDto = new HistoryEntryImportDto();
postEntryDto.note = note2.alias;
postEntryDto.pinStatus = pinStatus;
postEntryDto.lastVisited = lastVisited;
await request(app.getHttpServer())
.post('/me/history')
.set('Content-Type', 'application/json')
@ -114,6 +117,7 @@ describe('History', () => {
expect(userEntries[0].note.alias).toEqual(note2.alias);
expect(userEntries[0].user.userName).toEqual(user.userName);
expect(userEntries[0].pinStatus).toEqual(pinStatus);
expect(userEntries[0].updatedAt).toEqual(lastVisited);
});
it('DELETE /me/history', async () => {