test: cover rewind selector fallback states#4905
Conversation
|
The Windows CI failure was unrelated to the RewindSelector tests. It came from
|
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅ — qwen3.7-max via Qwen Code /review
|
Heads-up: #4915 just merged a fix for the same two |
00b4a50 to
d9b87a8
Compare
|
Thanks for the heads-up! I rebased onto the latest Verified locally:
|
DragonnZhang
left a comment
There was a problem hiding this comment.
No issues found. LGTM! — Qwen Code /review
What this PR does
Adds focused regression coverage for additional RewindSelector fallback states in the rewind flow. This covers cases where file restore is unavailable because diff stats cannot be loaded, the selected turn has no prompt id, or file checkpointing is disabled and the selector uses the legacy confirmation path.
Why it's needed
This continues the test coverage work tracked in #4187. The previous PR covered restore-options rendering when file diff stats are available; this PR covers fallback paths that should still keep rewind usable and predictable when checkpoint metadata is missing or unavailable.
Reviewer Test Plan
How to verify
Run the focused CLI component test from
packages/cliand confirm all RewindSelector tests pass. I verified this locally withvitest run src/ui/components/RewindSelector.test.tsx --config vitest.config.ts; the suite passed with 6 tests.Evidence (Before & After)
N/A. This PR only adds regression tests and does not change user-visible runtime behavior.
Tested on
Environment (optional)
Tested locally on Windows with Node.js v24.14.0. Command run from
packages/cli:vitest run src/ui/components/RewindSelector.test.tsx --config vitest.config.ts.Risk & Scope
Linked Issues
Part of #4187.
中文说明
What this PR does
这个 PR 为 rewind 流程中的 RewindSelector 额外 fallback 状态添加了聚焦的回归测试。新增测试覆盖了文件恢复不可用的几种情况:diff stats 无法加载、选中的历史 turn 没有 prompt id,以及关闭 file checkpointing 时使用 legacy confirmation 路径。
Why it's needed
这个 PR 继续推进 #4187 中追踪的测试覆盖工作。上一个 PR 覆盖了存在文件 diff stats 时 restore-options 的渲染;这个 PR 覆盖 checkpoint 元数据缺失或不可用时的 fallback 路径,确保 rewind 在这些情况下仍然保持可用和行为可预期。
Reviewer Test Plan
How to verify
从
packages/cli目录运行聚焦的 CLI 组件测试,并确认所有 RewindSelector 测试通过。我已在本地使用vitest run src/ui/components/RewindSelector.test.tsx --config vitest.config.ts验证,该测试套件通过,共 6 个测试。Evidence (Before & After)
N/A。这个 PR 只新增回归测试,不改变用户可见的运行时行为。
Tested on
Environment (optional)
本地在 Windows 上使用 Node.js v24.14.0 测试。从
packages/cli目录运行的命令是:vitest run src/ui/components/RewindSelector.test.tsx --config vitest.config.ts。Risk & Scope
Linked Issues
Part of #4187.