mirror of
https://github.com/immich-app/immich.git
synced 2025-02-11 01:18:24 -05:00
parent
27be813011
commit
ee4d9fff16
2 changed files with 4 additions and 2 deletions
4
server/src/services/asset.service.spec.ts
Normal file → Executable file
4
server/src/services/asset.service.spec.ts
Normal file → Executable file
|
@ -311,13 +311,15 @@ describe(AssetService.name, () => {
|
|||
const image1 = { ...assetStub.image, localDateTime: new Date(2023, 1, 15, 0, 0, 0) };
|
||||
const image2 = { ...assetStub.image, localDateTime: new Date(2023, 1, 15, 1, 0, 0) };
|
||||
const image3 = { ...assetStub.image, localDateTime: new Date(2015, 1, 15) };
|
||||
const image4 = { ...assetStub.image, localDateTime: new Date(2009, 1, 15) };
|
||||
|
||||
partnerMock.getAll.mockResolvedValue([]);
|
||||
assetMock.getByDayOfYear.mockResolvedValue([image1, image2, image3]);
|
||||
assetMock.getByDayOfYear.mockResolvedValue([image1, image2, image3, image4]);
|
||||
|
||||
await expect(sut.getMemoryLane(authStub.admin, { day: 15, month: 1 })).resolves.toEqual([
|
||||
{ yearsAgo: 1, title: '1 year since...', assets: [mapAsset(image1), mapAsset(image2)] },
|
||||
{ yearsAgo: 9, title: '9 years since...', assets: [mapAsset(image3)] },
|
||||
{ yearsAgo: 15, title: '15 years since...', assets: [mapAsset(image4)] },
|
||||
]);
|
||||
|
||||
expect(assetMock.getByDayOfYear.mock.calls).toEqual([[[authStub.admin.user.id], { day: 15, month: 1 }]]);
|
||||
|
|
|
@ -184,7 +184,7 @@ export class AssetService {
|
|||
|
||||
return Object.keys(groups)
|
||||
.map(Number)
|
||||
.sort()
|
||||
.sort((a, b) => a - b)
|
||||
.filter((yearsAgo) => yearsAgo > 0)
|
||||
.map((yearsAgo) => ({
|
||||
yearsAgo,
|
||||
|
|
Loading…
Add table
Reference in a new issue