From 9a04dc3a3103d7897718ba257a15eab422d126ef Mon Sep 17 00:00:00 2001 From: Scrum4Me Agent <30029041+madhura68@users.noreply.github.com> Date: Thu, 7 May 2026 15:10:17 +0200 Subject: [PATCH] test(ST-cmovhvef3): add exhaustive re-grill canTransition test covering PLANNED Adds a loop test that asserts canTransition(status, 'GRILLING') for all statuses in GRILL_TRIGGERABLE_FROM that support the transition, explicitly documenting PLANNED as a valid re-grill entry point. --- __tests__/lib/idea-status.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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)