diff --git a/test/private-api/history.e2e-spec.ts b/test/private-api/history.e2e-spec.ts index 6e5b29890..79eb8d0e9 100644 --- a/test/private-api/history.e2e-spec.ts +++ b/test/private-api/history.e2e-spec.ts @@ -185,7 +185,7 @@ describe('History', () => { const entry = await historyService.createOrUpdateHistoryEntry(note2, user); expect(entry.pinStatus).toBeFalsy(); await request(app.getHttpServer()) - .put(`/me/history/${entry.note.alias}`) + .put(`/me/history/${entry.note.alias || 'undefined'}`) .send({ pinStatus: true }) .expect(200); const userEntries = await historyService.getEntriesByUser(user); @@ -199,7 +199,7 @@ describe('History', () => { const entry2 = await historyService.createOrUpdateHistoryEntry(note, user); const entryDto = historyService.toHistoryEntryDto(entry2); await request(app.getHttpServer()) - .delete(`/me/history/${entry.note.alias}`) + .delete(`/me/history/${entry.note.alias || 'undefined'}`) .expect(200); const userEntries = await historyService.getEntriesByUser(user); expect(userEntries.length).toEqual(1); diff --git a/test/public-api/media.e2e-spec.ts b/test/public-api/media.e2e-spec.ts index b2dc81b8a..af6f558e9 100644 --- a/test/public-api/media.e2e-spec.ts +++ b/test/public-api/media.e2e-spec.ts @@ -134,7 +134,7 @@ describe('Media', () => { 'hardcoded', 'test_upload_media', ); - const filename = url.split('/').pop(); + const filename = url.split('/').pop() || ''; await request(app.getHttpServer()) .delete('/media/' + filename) .expect(204);