mirror of
https://github.com/immich-app/immich.git
synced 2026-07-31 16:11:03 -07:00
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { IntegrityService } from 'src/services/integrity.service';
|
|
import { newTestService, ServiceMocks } from 'test/utils';
|
|
|
|
describe(IntegrityService.name, () => {
|
|
let sut: IntegrityService;
|
|
let mocks: ServiceMocks;
|
|
|
|
beforeEach(() => {
|
|
({ sut, mocks } = newTestService(IntegrityService));
|
|
});
|
|
|
|
it('should work', () => {
|
|
expect(sut).toBeDefined();
|
|
});
|
|
|
|
describe('handleDeleteAllIntegrityReports', () => {
|
|
beforeEach(() => {
|
|
mocks.integrityReport.streamIntegrityReportsByProperty.mockReturnValue((function* () {})() as never);
|
|
});
|
|
|
|
it('should query all property types when no type specified', async () => {
|
|
await sut.handleDeleteAllIntegrityReports({});
|
|
|
|
expect(mocks.integrityReport.streamIntegrityReportsByProperty).toHaveBeenCalledWith(undefined, undefined);
|
|
expect(mocks.integrityReport.streamIntegrityReportsByProperty).toHaveBeenCalledWith('assetId', undefined);
|
|
expect(mocks.integrityReport.streamIntegrityReportsByProperty).toHaveBeenCalledWith('fileAssetId', undefined);
|
|
});
|
|
});
|
|
});
|