mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-31 23:28:34 -04:00
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:
parent
4f858c51d2
commit
adffd68e68
5 changed files with 102 additions and 13 deletions
|
@ -105,10 +105,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')
|
||||
|
@ -119,6 +122,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 () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue