fix(cleaner): guard missing session refresh config

This commit is contained in:
Misaka
2026-04-24 19:11:21 +08:00
parent e39fc87869
commit 664f26d63f
2 changed files with 25 additions and 5 deletions

View File

@@ -279,6 +279,14 @@ describe('CleanerApplicationService', () => {
expect(result.ordersProcessed).toBe(1)
})
it('should fall back to default session refresh threshold when cleaner config is missing', async () => {
const eventSender: any = { send: vi.fn() }
await service.runCleaner(eventSender, makeInput())
expect(lastCleanerInput?.sessionRefreshOrderThreshold).toBe(160)
})
it('should close ERP browser on success', async () => {
await service.runCleaner({ send: vi.fn() } as any, makeInput())