mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:17:11 -05:00 
			
		
		
		
	
							parent
							
								
									27be813011
								
							
						
					
					
						commit
						ee4d9fff16
					
				
							
								
								
									
										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 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 image2 = { ...assetStub.image, localDateTime: new Date(2023, 1, 15, 1, 0, 0) };
 | 
				
			||||||
      const image3 = { ...assetStub.image, localDateTime: new Date(2015, 1, 15) };
 | 
					      const image3 = { ...assetStub.image, localDateTime: new Date(2015, 1, 15) };
 | 
				
			||||||
 | 
					      const image4 = { ...assetStub.image, localDateTime: new Date(2009, 1, 15) };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      partnerMock.getAll.mockResolvedValue([]);
 | 
					      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([
 | 
					      await expect(sut.getMemoryLane(authStub.admin, { day: 15, month: 1 })).resolves.toEqual([
 | 
				
			||||||
        { yearsAgo: 1, title: '1 year since...', assets: [mapAsset(image1), mapAsset(image2)] },
 | 
					        { yearsAgo: 1, title: '1 year since...', assets: [mapAsset(image1), mapAsset(image2)] },
 | 
				
			||||||
        { yearsAgo: 9, title: '9 years since...', assets: [mapAsset(image3)] },
 | 
					        { 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 }]]);
 | 
					      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)
 | 
					    return Object.keys(groups)
 | 
				
			||||||
      .map(Number)
 | 
					      .map(Number)
 | 
				
			||||||
      .sort()
 | 
					      .sort((a, b) => a - b)
 | 
				
			||||||
      .filter((yearsAgo) => yearsAgo > 0)
 | 
					      .filter((yearsAgo) => yearsAgo > 0)
 | 
				
			||||||
      .map((yearsAgo) => ({
 | 
					      .map((yearsAgo) => ({
 | 
				
			||||||
        yearsAgo,
 | 
					        yearsAgo,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user