[035-focus-store-unit-tests]: Unit tests for MarkdownFocusStore#41
Conversation
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesTimer Resilience & Test Coverage
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/storage/src/focus_store.rs`:
- Around line 534-551: The test corrupted_timer_json_degrades_gracefully
hardcodes the slug "broken-timer" when building timer_path; change it to capture
the slug returned by MarkdownFocusStore::create_focus and use that slug to
construct timer_path so the test no longer depends on slugify behavior. Instruct
the test to call store.create_focus(...) and save its returned slug (or result)
instead of ignoring it, then use that slug when joining "<slug>/timer.json" to
write the corrupted JSON; update any variable names (e.g., timer_path)
accordingly so the test remains focused on sidecar corruption only.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 6c3ab3d1-da75-4645-bf10-ec34edbf4297
📒 Files selected for processing (1)
crates/storage/src/focus_store.rs
e20db99 to
785c1e1
Compare
Closes issues/035-focus-store-unit-tests.md Completion promise: MarkdownFocusStore has direct unit tests covering the create/list/delete/task mutation cycle and timer sidecar edge cases; the storage seam is independently trusted without Commands. - 8 new tests in focus_store.rs covering acceptance table - corrupted_timer_json now uses captured slug, not slugify assumption - list() degrades to timer: None on corrupted timer.json instead of failing the whole load - Drop stale ralph/ Taskfile include left over from dabed05
785c1e1 to
0bce410
Compare
Closes issues/035-focus-store-unit-tests.md
Summary
focus_store.rscovering the acceptance tableTempDir;corrupted_timer_json_degrades_gracefullycaptures the slug returned bycreate_focusinstead of hardcoding itlist()degrades totimer: Noneon corruptedtimer.jsoninstead of failing the whole loadralph/Taskfile include left over from dabed05Test plan
cargo test -p adhd-ranch-storagegreen in isolationtask checkgreenSummary by CodeRabbit
Release Notes
Bug Fixes
Tests