-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Create comprehensive unit tests for Stage 3 Review in src/tui/tests/review.test.ts:
Test groups:
-
Pure helper tests:
- intensityIndex: all 5 values + unknown
- textureIndex: all 9 values + unknown
- medianIntensity: odd count, even count, single entry, empty
- medianTextureIndex: same variations
- flagCoherenceOutliers: normal flagging, all same (no flags), <3 entries skip, boundary cases (exactly 1 step = no flag, exactly 2 steps = flag)
- buildSummaryRows: with and without outliers, warning indicator presence
-
Interactive flow tests:
- runReviewStage with confirm action returns 'advance'
- runReviewStage with back action returns 'back'
- runReviewStage swap flow (select recipe, mock audition, verify updated selection)
- runReviewStage add flow returns 'back' to re-enter Define
- runReviewStage remove flow (verify removal from session)
- <3 entries shows info message, skips coherence
- Empty palette after removal warns and prevents advance
Follow the mocking pattern from explore.test.ts: mock @inquirer/prompts, ../../output.js, ../../core/renderer.js, ../../audio/player.js.
Acceptance Criteria:
- All pure helpers have at least 2 test cases each
- All interactive flows have at least 1 test case each
- Coherence flagging has boundary tests
- Tests pass with npm test
Reactions are currently unavailable