forked from Cutlery/immich
fix test
This commit is contained in:
parent
5905fce428
commit
65d3990dce
@ -20,6 +20,7 @@ import {
|
|||||||
import { when } from 'jest-when';
|
import { when } from 'jest-when';
|
||||||
import { R_OK } from 'node:constants';
|
import { R_OK } from 'node:constants';
|
||||||
import { Stats } from 'node:fs';
|
import { Stats } from 'node:fs';
|
||||||
|
import { usePagination } from '../domain.util';
|
||||||
import { IEntityJob, ILibraryFileJob, ILibraryRefreshJob, JobName } from '../job';
|
import { IEntityJob, ILibraryFileJob, ILibraryRefreshJob, JobName } from '../job';
|
||||||
import {
|
import {
|
||||||
IAssetRepository,
|
IAssetRepository,
|
||||||
@ -280,6 +281,27 @@ describe(LibraryService.name, () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('handleQueueOfflineCheck', () => {
|
||||||
|
it('should queue a check of each asset', async () => {
|
||||||
|
const mockLibraryJob: IEntityJob = {
|
||||||
|
id: libraryStub.externalLibrary1.id,
|
||||||
|
};
|
||||||
|
|
||||||
|
assetMock.getWith.mockResolvedValue({
|
||||||
|
items: [assetStub.external],
|
||||||
|
hasNextPage: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await sut.handleQueueOfflineCheck(mockLibraryJob);
|
||||||
|
|
||||||
|
expect(result).toEqual(JobStatus.SUCCESS);
|
||||||
|
|
||||||
|
expect(jobMock.queueAll).toHaveBeenCalledWith([
|
||||||
|
{ name: JobName.LIBRARY_CHECK_OFFLINE, data: { id: assetStub.external.id } },
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('handleAssetRefresh', () => {
|
describe('handleAssetRefresh', () => {
|
||||||
let mockUser: UserEntity;
|
let mockUser: UserEntity;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user