-
-
Notifications
You must be signed in to change notification settings - Fork 848
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
Refacted : src/components/LeftDrawer/LeftDrawer.test.tsx from Jest to Vitest #3134
Refacted : src/components/LeftDrawer/LeftDrawer.test.tsx from Jest to Vitest #3134
Conversation
WalkthroughThis pull request focuses on refactoring the Changes
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (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: 0
🧹 Nitpick comments (1)
src/components/LeftDrawer/LeftDrawer.spec.tsx (1)
13-13
: Fix formatting to comply with Prettier requirements.The static analysis and pipeline logs indicate a spacing mismatch. Adjust the import statement to ensure proper spacing:
-import {vi , it , describe , beforeEach , afterEach , expect } from 'vitest'; +import { vi, it, describe, beforeEach, afterEach, expect } from 'vitest';🧰 Tools
🪛 eslint
[error] 13-13: Replace
vi·,·it·,·describe·,·beforeEach·,·afterEach·
with·vi,·it,·describe,·beforeEach,·afterEach
(prettier/prettier)
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. File needs to be formatted using Prettier.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/LeftDrawer/LeftDrawer.spec.tsx
(7 hunks)
🧰 Additional context used
📓 Learnings (2)
📓 Common learnings
Learnt from: bitbard3
PR: PalisadoesFoundation/talawa-admin#2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:145-155
Timestamp: 2024-12-02T04:20:11.745Z
Learning: In PRs focused solely on refactoring test cases from Jest to Vitest, avoid suggesting optimizations or changes outside the migration scope.
src/components/LeftDrawer/LeftDrawer.spec.tsx (2)
Learnt from: Doraemon012
PR: PalisadoesFoundation/talawa-admin#1988
File: src/components/LeftDrawerOrg/LeftDrawerOrg.test.tsx:282-282
Timestamp: 2024-11-12T10:40:58.654Z
Learning: In the test 'Component should be rendered properly' within 'Testing LeftDrawerOrg component for SUPERADMIN', setting 'SuperAdmin' to false is intentional.
Learnt from: bitbard3
PR: PalisadoesFoundation/talawa-admin#2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:145-155
Timestamp: 2024-12-02T04:20:11.745Z
Learning: In PRs focused solely on refactoring test cases from Jest to Vitest, avoid suggesting optimizations or changes outside the migration scope.
🪛 eslint
src/components/LeftDrawer/LeftDrawer.spec.tsx
[error] 13-13: Replace vi·,·it·,·describe·,·beforeEach·,·afterEach·
with ·vi,·it,·describe,·beforeEach,·afterEach
(prettier/prettier)
🪛 GitHub Actions: PR Workflow
src/components/LeftDrawer/LeftDrawer.spec.tsx
[warning] Code style issues found. File needs to be formatted using Prettier.
🔇 Additional comments (8)
src/components/LeftDrawer/LeftDrawer.spec.tsx (8)
19-19
: Acknowledging the use ofvi.fn()
as a replacement forjest.fn()
.The transition appears correct for Vitest usage and meets the migration objective. Good job!
🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. File needs to be formatted using Prettier.
42-46
: Mock updates forreact-toastify
are appropriate.Switching from
jest.mock()
tovi.mock()
andvi.fn()
ensures proper Vitest compatibility.🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. File needs to be formatted using Prettier.
60-60
: Clearing mocks withvi.clearAllMocks()
.Replacing
jest.clearAllMocks()
is aligned with the Vitest transition. No issues found.🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. File needs to be formatted using Prettier.
65-65
: Switchingtest()
toit()
for Vitest.This maintains the same behavior while aligning with Vitest conventions.
🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. File needs to be formatted using Prettier.
115-115
: Refactoring test block to useit()
.No logical changes noted; the move is straightforward and on target.
🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. File needs to be formatted using Prettier.
134-134
: Vitest-compatible test block name.Adopting
it()
helps keep the project consistent under Vitest.🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. File needs to be formatted using Prettier.
153-153
: Continued refactoring to Vitest syntax.This aligns well with the overall migration plan.
🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. File needs to be formatted using Prettier.
186-186
: Final test block updated toit()
.The test remains functionally identical. Everything looks good here.
🧰 Tools
🪛 GitHub Actions: PR Workflow
[warning] Code style issues found. File needs to be formatted using Prettier.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #3134 +/- ##
=====================================================
+ Coverage 21.89% 89.51% +67.61%
=====================================================
Files 301 322 +21
Lines 7685 8454 +769
Branches 1678 1843 +165
=====================================================
+ Hits 1683 7568 +5885
+ Misses 5896 655 -5241
- Partials 106 231 +125 ☔ View full report in Codecov by Sentry. |
fb48e16
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
Refracting src/components/LeftDrawer/LeftDrawer.test.tsx from Jest to Vitest
Issue number :
Fixes : #3119
Did you add tests for your changes?
Yes
Snapshots/Videos:
If relevant, did you update the documentation?
Does this PR introduce a breaking change?
No
Other information
No
Have you read the contributing guide?
Yes
Summary by CodeRabbit
LeftDrawer
component from Jest to Vitest