(rows: Array<{ id: string; organizationId: string }>)
| 24 | import { dispatchDueDrains, reapOrphanedRuns } from '@/lib/data-drains/dispatcher' |
| 25 | |
| 26 | function mockCandidates(rows: Array<{ id: string; organizationId: string }>) { |
| 27 | // db.select().from().where() — override `from` so awaiting `.where(pred)` |
| 28 | // resolves with the candidate rows. |
| 29 | dbChainMockFns.from.mockReturnValueOnce({ |
| 30 | where: vi.fn().mockResolvedValueOnce(rows), |
| 31 | } as never) |
| 32 | } |
| 33 | |
| 34 | beforeEach(() => { |
| 35 | vi.clearAllMocks() |