Skip to content

fix: lesson-flow tests for stream-driven practice#116

Merged
willwearing merged 1 commit into
mainfrom
fix/lesson-flow-test-stream-driven
Apr 12, 2026
Merged

fix: lesson-flow tests for stream-driven practice#116
willwearing merged 1 commit into
mainfrom
fix/lesson-flow-test-stream-driven

Conversation

@willwearing
Copy link
Copy Markdown
Owner

Summary

  • Adds kpPracticeDone state flag to lesson-flow.tsx to distinguish "no problem selected yet" from "all KPs passed" (both previously resulted in currentProblemId === null)
  • Updates test mocks to return nextProblemHint in API responses, matching the real stream-driven contract from the wrong-answer remediation loop
  • Fixes CI failure from feat: wrong-answer remediation loop #115 where 3 frontend tests expected intermediate "Practice complete" screens that no longer appear in the stream-driven flow

Test plan

  • All 7 lesson-flow.test.tsx tests pass
  • All 263 frontend tests pass (vitest)
  • All 613 backend tests pass
  • No type errors

🤖 Generated with Claude Code

The lesson-flow component now uses `nextProblemHint` from the backend to
drive practice progression instead of iterating a pre-computed list.
The frontend test mocks were returning responses without the hint,
causing the component to fall back to legacy behavior where
`currentProblemId=null` was ambiguous between "initial state" and
"practice complete".

Adds a `kpPracticeDone` state flag to distinguish these cases and
updates test mocks to return `nextProblemHint` matching the real API
contract. The stream-driven flow advances directly from one KP to the
next without an intermediate "Practice complete" screen for mid-lesson
KPs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
graspful Building Building Preview, Comment Apr 12, 2026 2:08am

@willwearing willwearing merged commit b1d2a49 into main Apr 12, 2026
2 of 3 checks passed
@willwearing willwearing deleted the fix/lesson-flow-test-stream-driven branch April 12, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant