diff --git a/__tests__/lib/idea-status.test.ts b/__tests__/lib/idea-status.test.ts index 9bedd32..b72692c 100644 --- a/__tests__/lib/idea-status.test.ts +++ b/__tests__/lib/idea-status.test.ts @@ -41,6 +41,7 @@ describe('canTransition', () => { it('allows re-grill from GRILLED and PLAN_READY-ish states', () => { expect(canTransition('GRILLED', 'GRILLING')).toBe(true) expect(canTransition('PLAN_FAILED', 'PLANNING')).toBe(true) + expect(canTransition('PLAN_READY', 'GRILLING')).toBe(true) }) it('allows fail-side transitions', () => { @@ -60,8 +61,8 @@ describe('canTransition', () => { }) 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 + // GRILL_TRIGGERABLE_FROM in actions/ideas.ts — alle statussen die re-grill ondersteunen. + const regrill = ['DRAFT', 'GRILLED', 'GRILL_FAILED', 'PLAN_READY', 'PLANNED'] as const for (const status of regrill) { expect(canTransition(status, 'GRILLING')).toBe(true) } diff --git a/lib/idea-status.ts b/lib/idea-status.ts index 1cc94b2..e513245 100644 --- a/lib/idea-status.ts +++ b/lib/idea-status.ts @@ -53,7 +53,7 @@ const ALLOWED_TRANSITIONS: Record> = { GRILLED: ['GRILLING', 'PLANNING'], PLANNING: ['PLAN_READY', 'PLAN_FAILED'], PLAN_FAILED: ['PLANNING', 'GRILLED'], - PLAN_READY: ['PLANNING', 'PLANNED'], + PLAN_READY: ['PLANNING', 'PLANNED', 'GRILLING'], // GRILLING via startGrillJobAction (re-grill) PLANNED: ['PLAN_READY', 'GRILLING'], // PLAN_READY via relinkIdeaPlanAction; GRILLING via startGrillJobAction }