test(notes-service): Add test for toNoteMetadataDto with no alias

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-04-18 11:08:17 +02:00 committed by Philip Molares
parent 161329fa7c
commit 40c23acd49

View file

@ -483,6 +483,11 @@ describe('NotesService', () => {
expect(metadataDto.updateUsername).toEqual(user.username); expect(metadataDto.updateUsername).toEqual(user.username);
expect(metadataDto.viewCount).toEqual(note.viewCount); expect(metadataDto.viewCount).toEqual(note.viewCount);
}); });
it('returns publicId if no alias exists', async () => {
const [note, ,] = await getMockData();
const metadataDto = await service.toNoteMetadataDto(note);
expect(metadataDto.primaryAddress).toEqual(note.publicId);
});
}); });
describe('toNoteDto', () => { describe('toNoteDto', () => {