-
-
Notifications
You must be signed in to change notification settings - Fork 812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: src/screens/OrganizationFunds from Jest to Vitest #2685
Refactor: src/screens/OrganizationFunds from Jest to Vitest #2685
Conversation
WalkthroughThis pull request focuses on migrating the test files Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Learnings (2)📓 Common learnings
src/screens/OrganizationFunds/FundModal.tsx (1)
🔇 Additional comments (2)src/screens/OrganizationFunds/FundModal.tsx (2)
The simplified error casting is a safe improvement that maintains type safety.
The optimization to prevent unnecessary API calls when no fields have changed is a good improvement. Let's verify the test coverage for this optimization: ✅ Verification successfulLet me gather more context about the test implementation to verify if it properly checks the API call prevention. Let me check for the API mock setup and assertions in the test file to ensure it properly verifies that no API call is made. Test coverage for the early return optimization is complete and accurate The test case "should not update the fund when no fields are changed" properly verifies the optimization by:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check if there are tests covering the early return case
# Expected: Find test cases that verify no API calls are made when fields haven't changed
rg -A 5 "when no fields (are )?changed" "src/screens/OrganizationFunds/FundModal.spec.tsx"
Length of output: 391 Script: #!/bin/bash
# Get more context around the test case including assertions
rg -B 2 -A 15 "should not update the fund when no fields are changed" "src/screens/OrganizationFunds/FundModal.spec.tsx"
# Also check the mock setup for API calls
rg "mock\(" "src/screens/OrganizationFunds/FundModal.spec.tsx"
Length of output: 927 Script: #!/bin/bash
# Get the full test file content to check API mock setup and assertions
cat "src/screens/OrganizationFunds/FundModal.spec.tsx"
Length of output: 9835 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
Note: This organisation doesn't accept draft PRs |
sorry, should i make a new PR |
@prathmesh703 If it is not ready for review, you can close it. If you want to leave it open, please fix the failed tests. |
@Cioppolo14 @palisadoes fixed these failing tests in my PRs #2663 #2662 ..Merging them should fix these ..could you please look into it? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2685 +/- ##
=====================================================
+ Coverage 77.00% 87.08% +10.08%
=====================================================
Files 295 312 +17
Lines 7289 8148 +859
Branches 1593 1784 +191
=====================================================
+ Hits 5613 7096 +1483
+ Misses 1412 875 -537
+ Partials 264 177 -87 ☔ View full report in Codecov by Sentry. |
Thanks @shivasankaran18 after merging it fixed the failing test . @Cioppolo14 @palisadoes fixed the failing test |
@prathmesh703 Can you increase test coverage so that the remaining lines get cover for
|
ok |
@varshith257 increased the test coverage |
@Cioppolo14 @palisadoes can you review the PR ? |
fd0fe5c
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
refactoring
Issue Number:
Fixes #2561
Did you add tests for your changes?
no
Snapshots/Videos:
Summary
refactored two files from jest to vitest framework
1.OrganizationFunds
2.FundModal
Does this PR introduce a breaking change?
NO
Have you read the contributing guide?
YES
Summary by CodeRabbit
FundModal
andOrganizationFunds
components.useParams
inOrganizationFunds
tests.FundModal
to verify no updates occur when no fields are changed.