From 5520db10afb6da060eda72d17d0799c38c4a4c50 Mon Sep 17 00:00:00 2001 From: Min Idzelis Date: Sat, 3 May 2025 13:58:46 +0000 Subject: [PATCH] lint/tests --- server/src/queries/asset.repository.sql | 1 + web/src/lib/stores/assets-store.spec.ts | 6 +++--- web/src/test-data/factories/asset-factory.ts | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/server/src/queries/asset.repository.sql b/server/src/queries/asset.repository.sql index e616118f2f..02ae5e7806 100644 --- a/server/src/queries/asset.repository.sql +++ b/server/src/queries/asset.repository.sql @@ -272,6 +272,7 @@ select "exif"."projectionType", "exif"."city" as "city", "exif"."country" as "country", + to_json("localDateTime" at time zone 'UTC') #>> '{}' as "localDateTime", to_json("stacked_assets") as "stack" from "assets" diff --git a/web/src/lib/stores/assets-store.spec.ts b/web/src/lib/stores/assets-store.spec.ts index d5546a78bb..37cc639467 100644 --- a/web/src/lib/stores/assets-store.spec.ts +++ b/web/src/lib/stores/assets-store.spec.ts @@ -53,15 +53,15 @@ describe('AssetStore', () => { expect(plainBuckets).toEqual( expect.arrayContaining([ - expect.objectContaining({ bucketDate: '2024-03-01T00:00:00.000Z', bucketHeight: 186.5 }), - expect.objectContaining({ bucketDate: '2024-02-01T00:00:00.000Z', bucketHeight: 12_017 }), + expect.objectContaining({ bucketDate: '2024-03-01T00:00:00.000Z', bucketHeight: 185.5 }), + expect.objectContaining({ bucketDate: '2024-02-01T00:00:00.000Z', bucketHeight: 12_016 }), expect.objectContaining({ bucketDate: '2024-01-01T00:00:00.000Z', bucketHeight: 286 }), ]), ); }); it('calculates timeline height', () => { - expect(assetStore.timelineHeight).toBe(12_489.5); + expect(assetStore.timelineHeight).toBe(12487.5); }); }); diff --git a/web/src/test-data/factories/asset-factory.ts b/web/src/test-data/factories/asset-factory.ts index 80158492c1..3d92c12bc3 100644 --- a/web/src/test-data/factories/asset-factory.ts +++ b/web/src/test-data/factories/asset-factory.ts @@ -75,20 +75,20 @@ export const toResponseDto = (...timelineAsset: TimelineAsset[]) => { }; for (const asset of timelineAsset) { bucketAssets.description.push(asset.description); - bucketAssets.duration.push(asset.duration); + bucketAssets.duration.push(asset.duration!); bucketAssets.id.push(asset.id); bucketAssets.isArchived.push(asset.isArchived ? 1 : 0); bucketAssets.isFavorite.push(asset.isFavorite ? 1 : 0); bucketAssets.isImage.push(asset.isImage ? 1 : 0); bucketAssets.isTrashed.push(asset.isTrashed ? 1 : 0); bucketAssets.isVideo.push(asset.isVideo ? 1 : 0); - bucketAssets.livePhotoVideoId.push(asset.livePhotoVideoId); + bucketAssets.livePhotoVideoId.push(asset.livePhotoVideoId!); bucketAssets.localDateTime.push(asset.localDateTime); bucketAssets.ownerId.push(asset.ownerId); - bucketAssets.projectionType.push(asset.projectionType); + bucketAssets.projectionType.push(asset.projectionType!); bucketAssets.ratio.push(asset.ratio); bucketAssets.stack.push(asset.stack as TimelineStackResponseDto); - bucketAssets.thumbhash.push(asset.thumbhash); + bucketAssets.thumbhash.push(asset.thumbhash!); } const response: TimeBucketResponseDto = { bucketAssets,