2023-08-01 03:28:07 +02:00
|
|
|
import { AlbumEntity } from '@app/infra/entities';
|
|
|
|
import { assetStub } from './asset.stub';
|
|
|
|
import { authStub } from './auth.stub';
|
|
|
|
import { userStub } from './user.stub';
|
|
|
|
|
|
|
|
export const albumStub = {
|
|
|
|
empty: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-1',
|
|
|
|
albumName: 'Empty album',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-01 03:28:07 +02:00
|
|
|
ownerId: authStub.admin.id,
|
|
|
|
owner: userStub.admin,
|
|
|
|
assets: [],
|
|
|
|
albumThumbnailAsset: null,
|
|
|
|
albumThumbnailAssetId: null,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [],
|
|
|
|
}),
|
|
|
|
sharedWithUser: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-2',
|
|
|
|
albumName: 'Empty album shared with user',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-01 03:28:07 +02:00
|
|
|
ownerId: authStub.admin.id,
|
|
|
|
owner: userStub.admin,
|
|
|
|
assets: [],
|
|
|
|
albumThumbnailAsset: null,
|
|
|
|
albumThumbnailAssetId: null,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [userStub.user1],
|
|
|
|
}),
|
|
|
|
sharedWithMultiple: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-3',
|
|
|
|
albumName: 'Empty album shared with users',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-01 03:28:07 +02:00
|
|
|
ownerId: authStub.admin.id,
|
|
|
|
owner: userStub.admin,
|
|
|
|
assets: [],
|
|
|
|
albumThumbnailAsset: null,
|
|
|
|
albumThumbnailAssetId: null,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [userStub.user1, userStub.user2],
|
|
|
|
}),
|
|
|
|
sharedWithAdmin: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-3',
|
|
|
|
albumName: 'Empty album shared with admin',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-01 03:28:07 +02:00
|
|
|
ownerId: authStub.user1.id,
|
|
|
|
owner: userStub.user1,
|
|
|
|
assets: [],
|
|
|
|
albumThumbnailAsset: null,
|
|
|
|
albumThumbnailAssetId: null,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [userStub.admin],
|
|
|
|
}),
|
|
|
|
oneAsset: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-4',
|
|
|
|
albumName: 'Album with one asset',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-01 03:28:07 +02:00
|
|
|
ownerId: authStub.admin.id,
|
|
|
|
owner: userStub.admin,
|
|
|
|
assets: [assetStub.image],
|
|
|
|
albumThumbnailAsset: null,
|
|
|
|
albumThumbnailAssetId: null,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [],
|
|
|
|
}),
|
2023-08-02 03:29:14 +02:00
|
|
|
twoAssets: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-4a',
|
|
|
|
albumName: 'Album with two assets',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-02 03:29:14 +02:00
|
|
|
ownerId: authStub.admin.id,
|
|
|
|
owner: userStub.admin,
|
|
|
|
assets: [assetStub.image, assetStub.withLocation],
|
|
|
|
albumThumbnailAsset: assetStub.image,
|
|
|
|
albumThumbnailAssetId: assetStub.image.id,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [],
|
|
|
|
}),
|
2023-08-01 03:28:07 +02:00
|
|
|
emptyWithInvalidThumbnail: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-5',
|
|
|
|
albumName: 'Empty album with invalid thumbnail',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-01 03:28:07 +02:00
|
|
|
ownerId: authStub.admin.id,
|
|
|
|
owner: userStub.admin,
|
|
|
|
assets: [],
|
|
|
|
albumThumbnailAsset: assetStub.image,
|
|
|
|
albumThumbnailAssetId: assetStub.image.id,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [],
|
|
|
|
}),
|
|
|
|
emptyWithValidThumbnail: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-5',
|
|
|
|
albumName: 'Empty album with invalid thumbnail',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-01 03:28:07 +02:00
|
|
|
ownerId: authStub.admin.id,
|
|
|
|
owner: userStub.admin,
|
|
|
|
assets: [],
|
|
|
|
albumThumbnailAsset: null,
|
|
|
|
albumThumbnailAssetId: null,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [],
|
|
|
|
}),
|
|
|
|
oneAssetInvalidThumbnail: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-6',
|
|
|
|
albumName: 'Album with one asset and invalid thumbnail',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-01 03:28:07 +02:00
|
|
|
ownerId: authStub.admin.id,
|
|
|
|
owner: userStub.admin,
|
|
|
|
assets: [assetStub.image],
|
|
|
|
albumThumbnailAsset: assetStub.livePhotoMotionAsset,
|
|
|
|
albumThumbnailAssetId: assetStub.livePhotoMotionAsset.id,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [],
|
|
|
|
}),
|
|
|
|
oneAssetValidThumbnail: Object.freeze<AlbumEntity>({
|
|
|
|
id: 'album-6',
|
|
|
|
albumName: 'Album with one asset and invalid thumbnail',
|
2023-08-06 04:43:26 +02:00
|
|
|
description: '',
|
2023-08-01 03:28:07 +02:00
|
|
|
ownerId: authStub.admin.id,
|
|
|
|
owner: userStub.admin,
|
|
|
|
assets: [assetStub.image],
|
|
|
|
albumThumbnailAsset: assetStub.image,
|
|
|
|
albumThumbnailAssetId: assetStub.image.id,
|
|
|
|
createdAt: new Date(),
|
|
|
|
updatedAt: new Date(),
|
|
|
|
sharedLinks: [],
|
|
|
|
sharedUsers: [],
|
|
|
|
}),
|
|
|
|
};
|