mirror of
https://github.com/immich-app/immich.git
synced 2026-03-22 14:29:26 +03:00
fix(server): flaky metadata tests (#26964)
This commit is contained in:
@@ -330,7 +330,7 @@ describe(MetadataService.name, () => {
|
|||||||
duration: null,
|
duration: null,
|
||||||
fileCreatedAt: asset.fileCreatedAt,
|
fileCreatedAt: asset.fileCreatedAt,
|
||||||
fileModifiedAt: asset.fileModifiedAt,
|
fileModifiedAt: asset.fileModifiedAt,
|
||||||
localDateTime: asset.localDateTime,
|
localDateTime: asset.fileCreatedAt,
|
||||||
width: null,
|
width: null,
|
||||||
height: null,
|
height: null,
|
||||||
});
|
});
|
||||||
@@ -360,7 +360,7 @@ describe(MetadataService.name, () => {
|
|||||||
duration: null,
|
duration: null,
|
||||||
fileCreatedAt: asset.fileCreatedAt,
|
fileCreatedAt: asset.fileCreatedAt,
|
||||||
fileModifiedAt: asset.fileModifiedAt,
|
fileModifiedAt: asset.fileModifiedAt,
|
||||||
localDateTime: asset.localDateTime,
|
localDateTime: asset.fileCreatedAt,
|
||||||
width: null,
|
width: null,
|
||||||
height: null,
|
height: null,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
UserLike,
|
UserLike,
|
||||||
} from 'test/factories/types';
|
} from 'test/factories/types';
|
||||||
import { UserFactory } from 'test/factories/user.factory';
|
import { UserFactory } from 'test/factories/user.factory';
|
||||||
import { newDate, newSha1, newUuid, newUuidV7 } from 'test/small.factory';
|
import { newSha1, newUuid, newUuidV7 } from 'test/small.factory';
|
||||||
|
|
||||||
export class AssetFactory {
|
export class AssetFactory {
|
||||||
#owner!: UserFactory;
|
#owner!: UserFactory;
|
||||||
@@ -43,10 +43,12 @@ export class AssetFactory {
|
|||||||
|
|
||||||
const originalFileName = dto.originalFileName ?? (dto.type === AssetType.Video ? `MOV_${id}.mp4` : `IMG_${id}.jpg`);
|
const originalFileName = dto.originalFileName ?? (dto.type === AssetType.Video ? `MOV_${id}.mp4` : `IMG_${id}.jpg`);
|
||||||
|
|
||||||
|
let now = Date.now();
|
||||||
|
|
||||||
return new AssetFactory({
|
return new AssetFactory({
|
||||||
id,
|
id,
|
||||||
createdAt: newDate(),
|
createdAt: new Date(now++),
|
||||||
updatedAt: newDate(),
|
updatedAt: new Date(now++),
|
||||||
deletedAt: null,
|
deletedAt: null,
|
||||||
updateId: newUuidV7(),
|
updateId: newUuidV7(),
|
||||||
status: AssetStatus.Active,
|
status: AssetStatus.Active,
|
||||||
@@ -55,14 +57,14 @@ export class AssetFactory {
|
|||||||
deviceId: '',
|
deviceId: '',
|
||||||
duplicateId: null,
|
duplicateId: null,
|
||||||
duration: null,
|
duration: null,
|
||||||
fileCreatedAt: newDate(),
|
fileCreatedAt: new Date(now++),
|
||||||
fileModifiedAt: newDate(),
|
fileModifiedAt: new Date(now++),
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isFavorite: false,
|
isFavorite: false,
|
||||||
isOffline: false,
|
isOffline: false,
|
||||||
libraryId: null,
|
libraryId: null,
|
||||||
livePhotoVideoId: null,
|
livePhotoVideoId: null,
|
||||||
localDateTime: newDate(),
|
localDateTime: new Date(now),
|
||||||
originalFileName,
|
originalFileName,
|
||||||
originalPath: `/data/library/${originalFileName}`,
|
originalPath: `/data/library/${originalFileName}`,
|
||||||
ownerId: newUuid(),
|
ownerId: newUuid(),
|
||||||
|
|||||||
Reference in New Issue
Block a user