[test]: Unit test for bulk carry forward config validation#8319
[test]: Unit test for bulk carry forward config validation#8319rijulpoudel wants to merge 7 commits into
Conversation
…tionObject tables
…able numeric part
|
Warning One or more dependencies are approaching or past End-of-Life. |
|
Warning Review limit reached
Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChangesBulk clone validation
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts (1)
17-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
afterEachfor cleaning up mocks.Calling
jest.restoreAllMocks()at the end of a test means that if theexpectassertion fails, the mock won't be restored, potentially polluting subsequent tests. Consider extractingjest.restoreAllMocks()into anafterEachblock.
specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts#L17-L25: Remove inlinejest.restoreAllMocks()and add anafterEachblock at the suite level.specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts#L27-L35: Remove inlinejest.restoreAllMocks().specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts#L37-L45: Remove inlinejest.restoreAllMocks().specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts#L47-L55: Remove inlinejest.restoreAllMocks().🤖 Prompt for 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. In `@specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts` around lines 17 - 25, Move mock cleanup to a suite-level afterEach for the tests in specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts:17-25, removing the inline jest.restoreAllMocks() there. Also remove the inline cleanup from specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts:27-35, 37-45, and 47-55; the shared afterEach should restore mocks for all tests, including when assertions fail.
🤖 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.
Nitpick comments:
In
`@specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts`:
- Around line 17-25: Move mock cleanup to a suite-level afterEach for the tests
in
specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts:17-25,
removing the inline jest.restoreAllMocks() there. Also remove the inline cleanup
from
specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts:27-35,
37-45, and 47-55; the shared afterEach should restore mocks for all tests,
including when assertions fail.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6974bebd-e4f2-4868-9e90-2ae0fa8ccc96
📒 Files selected for processing (1)
specifyweb/frontend/js_src/lib/components/FormMeta/__tests__/CarryForward.test.ts
Fixes #8318
Summary by CodeRabbit