PrivateAPI: Add pinStatus to HistoryEntryImportDto

As the DTO is only for importing an existing history the pinStatus 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-10 23:31:18 +02:00 committed by David Mehren
parent 1154894876
commit eeaa74b385
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
5 changed files with 70 additions and 8 deletions

View file

@ -100,8 +100,10 @@ describe('History', () => {
});
it('POST /me/history', async () => {
const pinStatus = true;
const postEntryDto = new HistoryEntryImportDto();
postEntryDto.note = note2.alias;
postEntryDto.pinStatus = pinStatus;
await request(app.getHttpServer())
.post('/me/history')
.set('Content-Type', 'application/json')
@ -110,6 +112,8 @@ describe('History', () => {
const userEntries = await historyService.getEntriesByUser(user);
expect(userEntries.length).toEqual(1);
expect(userEntries[0].note.alias).toEqual(note2.alias);
expect(userEntries[0].user.userName).toEqual(user.userName);
expect(userEntries[0].pinStatus).toEqual(pinStatus);
});
it('DELETE /me/history', async () => {