package task import "testing" func TestValidStoryTransition_Valid(t *testing.T) { cases := []struct { from StoryState to StoryState }{ {StoryPending, StoryInProgress}, {StoryInProgress, StoryShippable}, {StoryInProgress, StoryNeedsFix}, {StoryNeedsFix, StoryInProgress}, {StoryShippable, StoryDeployed}, {StoryDeployed, StoryValidating}, {StoryValidating, StoryReviewReady}, {StoryValidating, StoryNeedsFix}, } for _, tc := range cases { if !ValidStoryTransition(tc.from, tc.to) { t.Errorf("expected valid transition %s → %s", tc.from, tc.to) } } } func TestValidStoryTransition_Invalid(t *testing.T) { cases := []struct { from StoryState to StoryState }{ {StoryPending, StoryDeployed}, {StoryReviewReady, StoryPending}, {StoryReviewReady, StoryInProgress}, {StoryReviewReady, StoryShippable}, {StoryShippable, StoryPending}, } for _, tc := range cases { if ValidStoryTransition(tc.from, tc.to) { t.Errorf("expected invalid transition %s → %s", tc.from, tc.to) } } }