diff --git a/__tests__/lib/idea-status.test.ts b/__tests__/lib/idea-status.test.ts index 7adfbd4..9bedd32 100644 --- a/__tests__/lib/idea-status.test.ts +++ b/__tests__/lib/idea-status.test.ts @@ -59,6 +59,14 @@ describe('canTransition', () => { expect(canTransition('PLANNED', 'DRAFT')).toBe(false) }) + it('canTransition to GRILLING from all statuses that allow re-grill', () => { + // DRAFT, GRILLED, GRILL_FAILED, PLANNED are in GRILL_TRIGGERABLE_FROM and support the transition. + const regrill = ['DRAFT', 'GRILLED', 'GRILL_FAILED', 'PLANNED'] as const + for (const status of regrill) { + expect(canTransition(status, 'GRILLING')).toBe(true) + } + }) + it('rejects invalid jumps', () => { expect(canTransition('DRAFT', 'PLANNED')).toBe(false) expect(canTransition('DRAFT', 'PLAN_READY')).toBe(false)