mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
26 lines
710 B
TypeScript
26 lines
710 B
TypeScript
import { JobStatus } from 'src/enum';
|
|
import { AuditService } from 'src/services/audit.service';
|
|
import { newTestService, ServiceMocks } from 'test/utils';
|
|
|
|
describe(AuditService.name, () => {
|
|
let sut: AuditService;
|
|
let mocks: ServiceMocks;
|
|
|
|
beforeEach(() => {
|
|
({ sut, mocks } = newTestService(AuditService));
|
|
});
|
|
|
|
it('should work', () => {
|
|
expect(sut).toBeDefined();
|
|
});
|
|
|
|
describe('handleCleanup', () => {
|
|
it('should delete old audit entries', async () => {
|
|
mocks.audit.removeBefore.mockResolvedValue();
|
|
|
|
await expect(sut.handleCleanup()).resolves.toBe(JobStatus.Success);
|
|
|
|
expect(mocks.audit.removeBefore).toHaveBeenCalledWith(expect.any(Date));
|
|
});
|
|
});
|
|
});
|