-
-
Notifications
You must be signed in to change notification settings - Fork 811
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
migrate errorHandler tests from Jest to Vitest #2927
migrate errorHandler tests from Jest to Vitest #2927
Conversation
WalkthroughThe pull request introduces modifications to two test files: Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/utils/errorHandler.spec.tsx (1)
20-20
: Consider removing or refining this debug log.Printing within tests can clutter test output and isn't typically necessary unless troubleshooting. If the log is strictly needed, consider a more controlled approach (e.g., debug-level logging) or remove it to keep the test logs clean.
- console.log(`options are passed, but the function returns only ${key}`); + // Consider removing the console.log or replacing with a debug-level log if truly needed.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/screens/OrganizationDashboard/OrganizationDashboard.spec.tsx
(2 hunks)src/utils/errorHandler.spec.tsx
(1 hunks)
🔇 Additional comments (4)
src/utils/errorHandler.spec.tsx (2)
1-2
: Use of a type alias for TFunction
is suitable.
This type alias is a clear and concise way to represent the translation function signature.
13-104
: Overall test coverage and clarity are excellent.
The usage of test.each
and custom logic to handle different error patterns is thorough. The mocking approach for toast.error
is implemented correctly, and the parameterized tests ensure multiple edge cases are covered effectively.
src/screens/OrganizationDashboard/OrganizationDashboard.spec.tsx (2)
150-150
: Improved clarity in wait message.
Renaming the comment to "First wait for the dashboard to fully load" clarifies the intent and flow of the test.
163-163
: Comment encourages flexible assertion technique.
Changing the comment to "Use a more flexible matcher" indicates better clarity in the test approach.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2927 +/- ##
=====================================================
+ Coverage 49.48% 88.13% +38.64%
=====================================================
Files 299 316 +17
Lines 7414 8265 +851
Branches 1621 1810 +189
=====================================================
+ Hits 3669 7284 +3615
+ Misses 3499 770 -2729
+ Partials 246 211 -35 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You haven't deleted the orginal test file as requested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments on editing
- src/screens/OrganizationDashboard/OrganizationDashboard.spec.tsx
a630a91
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
Refactor: Migration from Jest to Vitest for error handler test files
Issue Number:
Fixes #2758
Did you add tests for your changes?
Yes. The migrated tests maintain 100% coverage and all tests are passing.
Snapshots/Videos:
Screencast.from.2024-12-26.18-27-08.mp4
If relevant, did you update the documentation?
N/A - This is a test file migration
Summary
This PR migrates error handler test files from Jest to Vitest as part of our ongoing migration to Vitest.
Key changes:
Does this PR introduce a breaking change?
No
Have you read the contributing guide?
Yes
Summary by CodeRabbit