1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-04 02:46:47 +01:00
This commit is contained in:
Matthias Rupp 2022-11-21 20:27:10 +01:00
parent 7653eda8b3
commit 33b7d1fc06

View file

@ -11,11 +11,13 @@ import { DownloadService } from '../../modules/download/download.service';
import { BackgroundTaskService } from '../../modules/background-task/background-task.service'; import { BackgroundTaskService } from '../../modules/background-task/background-task.service';
import { IAssetUploadedJob, IVideoTranscodeJob } from '@app/job'; import { IAssetUploadedJob, IVideoTranscodeJob } from '@app/job';
import { Queue } from 'bull'; import { Queue } from 'bull';
import { IAlbumRepository } from "../album/album-repository";
describe('AssetService', () => { describe('AssetService', () => {
let sui: AssetService; let sui: AssetService;
let a: Repository<AssetEntity>; // TO BE DELETED AFTER FINISHED REFACTORING let a: Repository<AssetEntity>; // TO BE DELETED AFTER FINISHED REFACTORING
let assetRepositoryMock: jest.Mocked<IAssetRepository>; let assetRepositoryMock: jest.Mocked<IAssetRepository>;
let albumRepositoryMock: jest.Mocked<IAlbumRepository>;
let downloadServiceMock: jest.Mocked<Partial<DownloadService>>; let downloadServiceMock: jest.Mocked<Partial<DownloadService>>;
let backgroundTaskServiceMock: jest.Mocked<BackgroundTaskService>; let backgroundTaskServiceMock: jest.Mocked<BackgroundTaskService>;
let assetUploadedQueueMock: jest.Mocked<Queue<IAssetUploadedJob>>; let assetUploadedQueueMock: jest.Mocked<Queue<IAssetUploadedJob>>;
@ -122,6 +124,7 @@ describe('AssetService', () => {
getAssetWithNoThumbnail: jest.fn(), getAssetWithNoThumbnail: jest.fn(),
getAssetWithNoSmartInfo: jest.fn(), getAssetWithNoSmartInfo: jest.fn(),
getExistingAssets: jest.fn(), getExistingAssets: jest.fn(),
countByIdAndUser: jest.fn(),
}; };
downloadServiceMock = { downloadServiceMock = {
@ -130,6 +133,7 @@ describe('AssetService', () => {
sui = new AssetService( sui = new AssetService(
assetRepositoryMock, assetRepositoryMock,
albumRepositoryMock,
a, a,
backgroundTaskServiceMock, backgroundTaskServiceMock,
assetUploadedQueueMock, assetUploadedQueueMock,