-
-
Notifications
You must be signed in to change notification settings - Fork 789
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
Fix: Improve code coverage in src/screens/forgot password #3109
Fix: Improve code coverage in src/screens/forgot password #3109
Conversation
WalkthroughThis pull request focuses on refactoring the Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🧰 Additional context used📓 Learnings (1)📓 Common learnings
🔇 Additional comments (15)src/screens/ForgotPassword/ForgotPassword.tsx (1)
Switching from src/screens/ForgotPassword/ForgotPassword.spec.tsx (14)
Importing
Replacing Jest globals with Vitest (
Using
Defining this successful response block ensures coverage of the happy path in the
By pushing the browser history state and validating the pathname, these checks fully cover the “already logged in” scenario. Also applies to: 141-141
Ensures behavior is tested when the user is already logged in.
Providing the user’s email and expecting a success toast increases coverage for OTP generation flow.
Validates that
This verifies correct fallback behavior when
Assertions confirm user feedback when the new password fields differ, further increasing code coverage.
Covers the API error condition to ensure the correct toast message is displayed.
Ensures that unexpected errors trigger the correct fallback path, maintaining robust coverage.
Guarantees the user sees the correct error message when Talawa’s API is unreachable.
Ensures the function gracefully handles a missing OTP token, preserving workflow integrity. 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
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #3109 +/- ##
=====================================================
+ Coverage 25.37% 89.32% +63.95%
=====================================================
Files 301 322 +21
Lines 7623 8421 +798
Branches 1667 1897 +230
=====================================================
+ Hits 1934 7522 +5588
+ Misses 5562 665 -4897
- Partials 127 234 +107 ☔ View full report in Codecov by Sentry. |
9e43fa5
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
This PR will migrate
src/screens/ForgotPassword/ForgotPassword.tsx
from Jest to Vitest also improve its code coverage to 100%.Removed
Istanbul ignore next
comments.Issue Number:
Fixes #3025
Fixes #2551
Did you add tests for your changes?
Yes
Snapshots/Videos:
If relevant, did you update the documentation?
N/A
Summary
Does this PR introduce a breaking change?
No
Other information
At one place we are using
istanbul ignore else
statement because there we don't need else statement.Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Tests
Chores