chore(server): move dtos (#8131)

move dtos
This commit is contained in:
Daniel Dietzler
2024-03-20 23:53:07 +01:00
committed by GitHub
parent 0c13c63bb6
commit 6d9e7694b1
145 changed files with 917 additions and 964 deletions

View File

@@ -0,0 +1,16 @@
import { mapAlbum } from 'src/dtos/album.dto';
import { albumStub } from 'test/fixtures/album.stub';
describe('mapAlbum', () => {
it('should set start and end dates', () => {
const dto = mapAlbum(albumStub.twoAssets, false);
expect(dto.startDate).toEqual(new Date('2023-02-22T05:06:29.716Z'));
expect(dto.endDate).toEqual(new Date('2023-02-23T05:06:29.716Z'));
});
it('should not set start and end dates for empty assets', () => {
const dto = mapAlbum(albumStub.empty, false);
expect(dto.startDate).toBeUndefined();
expect(dto.endDate).toBeUndefined();
});
});