fix(cli): pass rewind selector test props#4211
Conversation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
📋 Review SummaryThis PR fixes the 🔍 General Feedback
🎯 Specific FeedbackNo specific issues identified in this review.The PR correctly addresses the test setup issue. The implementation is sound:
✅ Highlights
|
wenshao
left a comment
There was a problem hiding this comment.
Review Summary
This PR fixes the RewindSelector test by adding missing required props (fileCheckpointingEnabled, fileHistoryService) after the component API changed. Clean mechanical fix — the 6-line change is correct, follows existing conventions, and tests pass locally.
Finding
Nice to have: The fileCheckpointingEnabled: true checkpointing path remains untested. The current test only exercises fileCheckpointingEnabled={false}. While this PR is focused on fixing test compilation, adding coverage for the checkpointing path (loading diff, showing restore options, handling restore) would be a valuable follow-up.
No Critical or Suggestion issues found. Security, correctness, code quality, and performance checks all passed.
— DeepSeek/deepseek-v4-pro via Qwen Code /review
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
| import { FileHistoryService } from '@qwen-code/qwen-code-core'; | ||
| import type { HistoryItem } from '../types.js'; | ||
| import type { KeypressHandler, Key } from '../contexts/KeypressContext.js'; | ||
| import { useKeypress } from '../hooks/useKeypress.js'; |
There was a problem hiding this comment.
suggestion: Consider using a mock/stub instead of instantiating the real FileHistoryService. Since fileCheckpointingEnabled={false} means the component won't call any methods on this service, a simple cast is sufficient and avoids potential filesystem side-effects in unit tests:
| import { useKeypress } from '../hooks/useKeypress.js'; | |
| fileHistoryService = {} as FileHistoryService; |
Review SummaryClean mechanical fix — no issues found beyond the inline suggestion already posted. Verified:
One suggestion (non-blocking): use Ship it. |
Summary
Fix the RewindSelector test setup so it passes the required file checkpointing props after the component API changed.
Test plan