2025-04-11 14:44:45 -04:00
|
|
|
import { AssetType } from 'src/enum';
|
|
|
|
import { previewFile } from 'test/fixtures/asset.stub';
|
2024-03-20 19:32:04 +01:00
|
|
|
import { userStub } from 'test/fixtures/user.stub';
|
2023-07-31 21:28:07 -04:00
|
|
|
|
2025-04-11 14:44:45 -04:00
|
|
|
const updateId = '0d1173e3-4d80-4d76-b41e-57d56de21125';
|
|
|
|
|
2023-07-31 21:28:07 -04:00
|
|
|
export const personStub = {
|
2025-04-11 14:44:45 -04:00
|
|
|
noName: Object.freeze({
|
2023-07-31 21:28:07 -04:00
|
|
|
id: 'person-1',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2023-07-31 21:28:07 -04:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: '',
|
2023-08-18 22:10:29 +02:00
|
|
|
birthDate: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
thumbnailPath: '/path/to/thumbnail.jpg',
|
|
|
|
faces: [],
|
2023-09-08 08:49:43 +02:00
|
|
|
faceAssetId: null,
|
|
|
|
faceAsset: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
isHidden: false,
|
2025-02-04 09:52:17 +01:00
|
|
|
isFavorite: false,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
2023-07-31 21:28:07 -04:00
|
|
|
}),
|
2025-04-11 14:44:45 -04:00
|
|
|
hidden: Object.freeze({
|
2023-07-31 21:28:07 -04:00
|
|
|
id: 'person-1',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2023-07-31 21:28:07 -04:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: '',
|
2023-08-18 22:10:29 +02:00
|
|
|
birthDate: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
thumbnailPath: '/path/to/thumbnail.jpg',
|
|
|
|
faces: [],
|
2023-09-08 08:49:43 +02:00
|
|
|
faceAssetId: null,
|
|
|
|
faceAsset: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
isHidden: true,
|
2025-02-04 09:52:17 +01:00
|
|
|
isFavorite: false,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
2023-07-31 21:28:07 -04:00
|
|
|
}),
|
2025-04-11 14:44:45 -04:00
|
|
|
withName: Object.freeze({
|
2023-07-31 21:28:07 -04:00
|
|
|
id: 'person-1',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2023-07-31 21:28:07 -04:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: 'Person 1',
|
2023-08-18 22:10:29 +02:00
|
|
|
birthDate: null,
|
|
|
|
thumbnailPath: '/path/to/thumbnail.jpg',
|
|
|
|
faces: [],
|
2023-12-05 16:43:15 +01:00
|
|
|
faceAssetId: 'assetFaceId',
|
2023-09-08 08:49:43 +02:00
|
|
|
faceAsset: null,
|
2023-08-18 22:10:29 +02:00
|
|
|
isHidden: false,
|
2025-02-04 09:52:17 +01:00
|
|
|
isFavorite: false,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
2023-08-18 22:10:29 +02:00
|
|
|
}),
|
2025-04-11 14:44:45 -04:00
|
|
|
withBirthDate: Object.freeze({
|
2023-08-18 22:10:29 +02:00
|
|
|
id: 'person-1',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2023-08-18 22:10:29 +02:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: 'Person 1',
|
2025-04-11 14:44:45 -04:00
|
|
|
birthDate: new Date('1976-06-30'),
|
2023-07-31 21:28:07 -04:00
|
|
|
thumbnailPath: '/path/to/thumbnail.jpg',
|
|
|
|
faces: [],
|
2023-09-08 08:49:43 +02:00
|
|
|
faceAssetId: null,
|
|
|
|
faceAsset: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
isHidden: false,
|
2025-02-04 09:52:17 +01:00
|
|
|
isFavorite: false,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
2023-07-31 21:28:07 -04:00
|
|
|
}),
|
2025-04-11 14:44:45 -04:00
|
|
|
noThumbnail: Object.freeze({
|
2023-07-31 21:28:07 -04:00
|
|
|
id: 'person-1',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2023-07-31 21:28:07 -04:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: '',
|
2023-08-18 22:10:29 +02:00
|
|
|
birthDate: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
thumbnailPath: '',
|
|
|
|
faces: [],
|
2023-09-08 08:49:43 +02:00
|
|
|
faceAssetId: null,
|
|
|
|
faceAsset: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
isHidden: false,
|
2025-02-04 09:52:17 +01:00
|
|
|
isFavorite: false,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
2023-07-31 21:28:07 -04:00
|
|
|
}),
|
2025-04-11 14:44:45 -04:00
|
|
|
newThumbnail: Object.freeze({
|
2023-07-31 21:28:07 -04:00
|
|
|
id: 'person-1',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2023-07-31 21:28:07 -04:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: '',
|
2023-08-18 22:10:29 +02:00
|
|
|
birthDate: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
thumbnailPath: '/new/path/to/thumbnail.jpg',
|
|
|
|
faces: [],
|
2023-12-05 16:43:15 +01:00
|
|
|
faceAssetId: 'asset-id',
|
|
|
|
faceAsset: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
isHidden: false,
|
2025-02-04 09:52:17 +01:00
|
|
|
isFavorite: false,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
2023-07-31 21:28:07 -04:00
|
|
|
}),
|
2025-04-11 14:44:45 -04:00
|
|
|
primaryPerson: Object.freeze({
|
2023-07-31 21:28:07 -04:00
|
|
|
id: 'person-1',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2023-07-31 21:28:07 -04:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: 'Person 1',
|
2023-08-18 22:10:29 +02:00
|
|
|
birthDate: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
thumbnailPath: '/path/to/thumbnail',
|
|
|
|
faces: [],
|
2023-09-08 08:49:43 +02:00
|
|
|
faceAssetId: null,
|
|
|
|
faceAsset: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
isHidden: false,
|
2025-02-04 09:52:17 +01:00
|
|
|
isFavorite: false,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
2023-07-31 21:28:07 -04:00
|
|
|
}),
|
2025-04-11 14:44:45 -04:00
|
|
|
mergePerson: Object.freeze({
|
2023-07-31 21:28:07 -04:00
|
|
|
id: 'person-2',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2023-07-31 21:28:07 -04:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: 'Person 2',
|
2023-08-18 22:10:29 +02:00
|
|
|
birthDate: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
thumbnailPath: '/path/to/thumbnail',
|
|
|
|
faces: [],
|
2023-09-08 08:49:43 +02:00
|
|
|
faceAssetId: null,
|
|
|
|
faceAsset: null,
|
2023-07-31 21:28:07 -04:00
|
|
|
isHidden: false,
|
2025-02-04 09:52:17 +01:00
|
|
|
isFavorite: false,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
2023-07-31 21:28:07 -04:00
|
|
|
}),
|
2025-04-11 14:44:45 -04:00
|
|
|
randomPerson: Object.freeze({
|
2024-01-19 18:52:26 +01:00
|
|
|
id: 'person-3',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2024-01-19 18:52:26 +01:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: '',
|
|
|
|
birthDate: null,
|
|
|
|
thumbnailPath: '/path/to/thumbnail',
|
|
|
|
faces: [],
|
|
|
|
faceAssetId: null,
|
|
|
|
faceAsset: null,
|
|
|
|
isHidden: false,
|
2025-02-04 09:52:17 +01:00
|
|
|
isFavorite: false,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
2025-02-04 09:52:17 +01:00
|
|
|
}),
|
2025-04-11 14:44:45 -04:00
|
|
|
isFavorite: Object.freeze({
|
2025-02-04 09:52:17 +01:00
|
|
|
id: 'person-4',
|
|
|
|
createdAt: new Date('2021-01-01'),
|
|
|
|
updatedAt: new Date('2021-01-01'),
|
2025-04-11 14:44:45 -04:00
|
|
|
updateId,
|
2025-02-04 09:52:17 +01:00
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
name: 'Person 1',
|
|
|
|
birthDate: null,
|
|
|
|
thumbnailPath: '/path/to/thumbnail.jpg',
|
|
|
|
faces: [],
|
|
|
|
faceAssetId: 'assetFaceId',
|
|
|
|
faceAsset: null,
|
|
|
|
isHidden: false,
|
|
|
|
isFavorite: true,
|
2025-04-11 14:44:45 -04:00
|
|
|
color: 'red',
|
|
|
|
}),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const personThumbnailStub = {
|
|
|
|
newThumbnailStart: Object.freeze({
|
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
x1: 5,
|
|
|
|
y1: 5,
|
|
|
|
x2: 505,
|
|
|
|
y2: 505,
|
|
|
|
oldHeight: 2880,
|
|
|
|
oldWidth: 2160,
|
2025-07-15 14:50:13 -04:00
|
|
|
type: AssetType.Image,
|
2025-04-11 14:44:45 -04:00
|
|
|
originalPath: '/original/path.jpg',
|
2025-05-06 14:18:22 -04:00
|
|
|
exifOrientation: '1',
|
2025-04-11 14:44:45 -04:00
|
|
|
previewPath: previewFile.path,
|
|
|
|
}),
|
|
|
|
newThumbnailMiddle: Object.freeze({
|
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
x1: 100,
|
|
|
|
y1: 100,
|
|
|
|
x2: 200,
|
|
|
|
y2: 200,
|
|
|
|
oldHeight: 500,
|
|
|
|
oldWidth: 400,
|
2025-07-15 14:50:13 -04:00
|
|
|
type: AssetType.Image,
|
2025-04-11 14:44:45 -04:00
|
|
|
originalPath: '/original/path.jpg',
|
2025-05-06 14:18:22 -04:00
|
|
|
exifOrientation: '1',
|
2025-04-11 14:44:45 -04:00
|
|
|
previewPath: previewFile.path,
|
|
|
|
}),
|
|
|
|
newThumbnailEnd: Object.freeze({
|
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
x1: 300,
|
|
|
|
y1: 300,
|
|
|
|
x2: 495,
|
|
|
|
y2: 495,
|
|
|
|
oldHeight: 500,
|
|
|
|
oldWidth: 500,
|
2025-07-15 14:50:13 -04:00
|
|
|
type: AssetType.Image,
|
2025-04-11 14:44:45 -04:00
|
|
|
originalPath: '/original/path.jpg',
|
2025-05-06 14:18:22 -04:00
|
|
|
exifOrientation: '1',
|
|
|
|
previewPath: previewFile.path,
|
|
|
|
}),
|
|
|
|
rawEmbeddedThumbnail: Object.freeze({
|
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
x1: 100,
|
|
|
|
y1: 100,
|
|
|
|
x2: 200,
|
|
|
|
y2: 200,
|
|
|
|
oldHeight: 500,
|
|
|
|
oldWidth: 400,
|
2025-07-15 14:50:13 -04:00
|
|
|
type: AssetType.Image,
|
2025-05-06 14:18:22 -04:00
|
|
|
originalPath: '/original/path.dng',
|
|
|
|
exifOrientation: '1',
|
|
|
|
previewPath: previewFile.path,
|
|
|
|
}),
|
|
|
|
negativeCoordinate: Object.freeze({
|
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
x1: -176,
|
|
|
|
y1: -230,
|
|
|
|
x2: 193,
|
|
|
|
y2: 251,
|
|
|
|
oldHeight: 1440,
|
|
|
|
oldWidth: 2162,
|
2025-07-15 14:50:13 -04:00
|
|
|
type: AssetType.Image,
|
2025-05-06 14:18:22 -04:00
|
|
|
originalPath: '/original/path.jpg',
|
|
|
|
exifOrientation: '1',
|
|
|
|
previewPath: previewFile.path,
|
|
|
|
}),
|
|
|
|
overflowingCoordinate: Object.freeze({
|
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
x1: 2097,
|
|
|
|
y1: 0,
|
|
|
|
x2: 2171,
|
|
|
|
y2: 152,
|
|
|
|
oldHeight: 1440,
|
|
|
|
oldWidth: 2162,
|
2025-07-15 14:50:13 -04:00
|
|
|
type: AssetType.Image,
|
2025-05-06 14:18:22 -04:00
|
|
|
originalPath: '/original/path.jpg',
|
|
|
|
exifOrientation: '1',
|
2025-04-11 14:44:45 -04:00
|
|
|
previewPath: previewFile.path,
|
2024-01-19 18:52:26 +01:00
|
|
|
}),
|
2025-05-21 12:15:30 -04:00
|
|
|
videoThumbnail: Object.freeze({
|
|
|
|
ownerId: userStub.admin.id,
|
|
|
|
x1: 100,
|
|
|
|
y1: 100,
|
|
|
|
x2: 200,
|
|
|
|
y2: 200,
|
|
|
|
oldHeight: 500,
|
|
|
|
oldWidth: 400,
|
2025-07-15 14:50:13 -04:00
|
|
|
type: AssetType.Video,
|
2025-05-21 12:15:30 -04:00
|
|
|
originalPath: '/original/path.mp4',
|
|
|
|
exifOrientation: '1',
|
|
|
|
previewPath: previewFile.path,
|
|
|
|
}),
|
2023-07-31 21:28:07 -04:00
|
|
|
};
|