-
-
Notifications
You must be signed in to change notification settings - Fork 757
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:vitest to UserPortal/Organizations #2783
refactor:vitest to UserPortal/Organizations #2783
Conversation
Caution Review failedThe pull request is closed. WalkthroughThis pull request focuses on enhancing the test suite for the Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
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: 1
🧹 Nitpick comments (5)
src/screens/UserPortal/Organizations/Organizations.spec.tsx (5)
363-366
: Consider verifying the outcome after clearing the search input.
The test checks that "anyOrganization2" appears, but there is no final assertion verifying that the UI reverts to the default state once the input is cleared.userEvent.clear(screen.getByTestId('searchInput')); userEvent.click(searchBtn); await wait(); +expect(screen.queryByText('anyOrganization2')).not.toBeInTheDocument();
392-395
: Enhance assertions for joined organizations testing.
Confirming that "joinedOrganization" appears in the DOM is good, but you can also cross-check that elements belonging to "created organizations" do not show up unexpectedly, strengthening test coverage.
419-422
: Ensure the created organizations test verifies actual content.
As with the joined organizations test, verifying non-appearance of conflicting content (e.g., joined organizations) can provide better test certainty.
446-449
: “Join Now” button testing could be extended to assert functionality.
Right now, you’re confirming that the button renders. You could also check if it triggers any expected action (navigation, dialog, etc.).
493-496
: Verify the sidebar’s final state after reopening.
After clicking close and then open, you might add an assertion verifying that the sidebar is indeed visible again to solidify coverage.await act(async () => { const openMenuBtn = screen.getByTestId('openMenu'); openMenuBtn.click(); }); +await waitFor(() => { + const closeMenuBtn = screen.getByTestId('closeMenu'); + expect(closeMenuBtn).toBeInTheDocument(); +});
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/screens/UserPortal/Organizations/Organizations.spec.tsx
(8 hunks)
🔇 Additional comments (2)
src/screens/UserPortal/Organizations/Organizations.spec.tsx (2)
21-24
: Good use of comments to document your GraphQL mocks.
Providing a clear purpose for the mock data helps maintainers and contributors understand the scope and usage quickly.
324-327
: Documentation for the StaticMockLink
is concise and clear.
It is helpful to explain this custom link approach for new contributors, ensuring easier maintenance and troubleshooting.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2783 +/- ##
=====================================================
+ Coverage 70.01% 87.55% +17.53%
=====================================================
Files 296 313 +17
Lines 7358 8204 +846
Branches 1606 1792 +186
=====================================================
+ Hits 5152 7183 +2031
+ Misses 1960 827 -1133
+ Partials 246 194 -52 ☔ View full report in Codecov by Sentry. |
@coderabbitai full review |
✅ Actions performedFull review triggered. |
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.
Minor PR
aff65c9
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
Added Vitest to src/screens/UserPortal/Organizations
Issue Number: 2575
Fixes #2575
Did you add tests for your changes?
Yes
Snapshots/Videos:
If relevant, did you update the documentation?
Summary
Migrated the testing framework to Vitest.
Updated all test files and configurations to be compatible with Vitest's syntax and features.
Have you read the contributing guide?
Yes
Summary by CodeRabbit
Organizations
component with new test cases.