test(T-574): cron-cleanup test verwacht SKIPPED in deleteMany filter
Bijgewerkt na uitbreiding van cleanup-criteria met SKIPPED-jobs in T-572. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
273735384a
commit
ca1a89ca04
1 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ describe('POST /api/cron/cleanup-agent-artifacts', () => {
|
||||||
expect(mockPrisma.claudeJob.deleteMany).not.toHaveBeenCalled()
|
expect(mockPrisma.claudeJob.deleteMany).not.toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('200 met juiste secret + deleteMany aangeroepen voor FAILED/CANCELLED ouder dan 7 dagen', async () => {
|
it('200 met juiste secret + deleteMany aangeroepen voor FAILED/CANCELLED/SKIPPED ouder dan 7 dagen', async () => {
|
||||||
mockPrisma.claudeJob.deleteMany.mockResolvedValue({ count: 5 })
|
mockPrisma.claudeJob.deleteMany.mockResolvedValue({ count: 5 })
|
||||||
|
|
||||||
const res = await POST(makeReq({ authorization: 'Bearer ' + SECRET }))
|
const res = await POST(makeReq({ authorization: 'Bearer ' + SECRET }))
|
||||||
|
|
@ -51,7 +51,7 @@ describe('POST /api/cron/cleanup-agent-artifacts', () => {
|
||||||
expect(body.ran_at).toMatch(/^\d{4}-\d{2}-\d{2}T/)
|
expect(body.ran_at).toMatch(/^\d{4}-\d{2}-\d{2}T/)
|
||||||
|
|
||||||
const arg = mockPrisma.claudeJob.deleteMany.mock.calls[0][0]
|
const arg = mockPrisma.claudeJob.deleteMany.mock.calls[0][0]
|
||||||
expect(arg.where.status).toEqual({ in: ['FAILED', 'CANCELLED'] })
|
expect(arg.where.status).toEqual({ in: ['FAILED', 'CANCELLED', 'SKIPPED'] })
|
||||||
expect(arg.where.finished_at.lt).toBeInstanceOf(Date)
|
expect(arg.where.finished_at.lt).toBeInstanceOf(Date)
|
||||||
|
|
||||||
// cutoff should be approximately 7 days ago
|
// cutoff should be approximately 7 days ago
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue