-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
Cleared localstorage to solve flickering #2937
Cleared localstorage to solve flickering #2937
Conversation
WalkthroughThe pull request modifies the Changes
Assessment against linked 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 (2)
src/screens/OrgList/OrgList.test.tsx (1)
503-543
: Enhance test coverage by verifying the actual sorting outcome.
Although the toggle between latest and oldest is tested, the test does not validate whether the fetched or rendered data is actually sorted. You may consider adding assertions to confirm that the UI reflects the expected ordering of the organizations after toggling the sort option.src/screens/OrgList/OrganizationModal.tsx (1)
304-304
: Optional chaining for safer array length checks.
This condition is a good fix to avoid errors ifadminFor
isnull
orundefined
. For even more safety and code brevity, consider optional chaining:- {((adminFor && adminFor.length > 0) || superAdmin) && ( + {(adminFor?.length > 0 || superAdmin) && (
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/screens/OrgList/OrgList.test.tsx
(2 hunks)src/screens/OrgList/OrgList.tsx
(1 hunks)src/screens/OrgList/OrganizationModal.tsx
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/screens/OrgList/OrgList.tsx
🔇 Additional comments (1)
src/screens/OrgList/OrgList.test.tsx (1)
47-47
: Good practice to clear mocks after each test.
Using jest.clearAllMocks()
helps ensure isolation and prevents test pollution from inadvertently shared mocks.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2937 +/- ##
=====================================================
+ Coverage 43.57% 88.39% +44.82%
=====================================================
Files 299 316 +17
Lines 7420 8273 +853
Branches 1623 1869 +246
=====================================================
+ Hits 3233 7313 +4080
+ Misses 3958 742 -3216
+ Partials 229 218 -11 ☔ View full report in Codecov by Sentry. |
@palisadoes Can you please review the pr? This is linked to the same issue which was raised in talawa-api repo, but the fix had to be done in talawa-admin. |
167a846
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
I changed
src/screens/OrgList/OrgList.tsx
to solve the flickering issue. Clearing the local storage was the solution to it.Issue Number:
Fixes #2936
Did you add tests for your changes?
No
If relevant, did you update the documentation?
No
Does this PR introduce a breaking change?
No
Have you read the contributing guide?
Yes
Summary by CodeRabbit
Bug Fixes
Tests