test(mobile): mock useMealTypes in DiaryScreen tests - #2108
Conversation
Fixes a TypeError in DiaryScreen.test.tsx where DiaryScreen component invocations threw "useMealTypes is not a function". DiaryScreen calls useMealTypes() to resolve meal section labels, but the test file's explicit mock of src/hooks did not include useMealTypes.
PR Validation ResultsChange Detection
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe DiaryScreen test setup now includes a default ChangesDiaryScreen test setup
Estimated code review effort: 1 (Trivial) | ~2 minutes Mergeability Score: ⚪ Minimal · up to This PR adds the missing hook mock needed by DiaryScreen tests and does not change production behavior. No actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes a TypeError in DiaryScreen.test.tsx where DiaryScreen component invocations threw "useMealTypes is not a function".
DiaryScreen calls useMealTypes() to resolve meal section labels, but the test file's explicit mock of src/hooks did not include useMealTypes.
Related to PR #2063
Tip
Help us review and merge your PR faster!
Please ensure you have completed the Checklist below.
For Frontend changes, please run
pnpm run validateto check for any errors.PRs that include tests and clear screenshots are highly preferred!
Note: AI-generated descriptions must be manually edited for conciseness. Do not paste raw AI summaries.
Description
What problem does this PR solve?
(Keep it concise. 1–2 sentences.)
How did you implement the solution?
(Brief technical approach.)
Linked Issue: Closes #
How to Test
...PR Type
Checklist
All PRs:
New features only:
Frontend changes (
SparkyFitnessFrontend/):pnpm run validateand it passes.en) translation file.Backend changes (
SparkyFitnessServer/):rls_policies.sqlfor any new user-specific tables.UI changes (components, screens, pages):
Mobile changes (
SparkyFitnessMobile/):Screenshots
Click to expand
Before
After
Notes for Reviewers