Files
immich/server/src/dtos/album-response.dto.spec.ts
Carsten Otto da580d4685 fix: show local dates for range in album summary (#15654)
* fix(web): show local dates for range in album summary

* fix(server): show local dates for range in album summary
2025-01-28 14:33:38 -06:00

17 lines
595 B
TypeScript

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('2020-12-31T23:59:00.000Z'));
expect(dto.endDate).toEqual(new Date('2025-01-01T01:02:03.456Z'));
});
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();
});
});