Skip to content
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: src/screens/UserPortal/Volunteer/Actions from Jest to Vitest #2619

Open
wants to merge 15 commits into
base: develop-postgres
Choose a base branch
from

Conversation

MayankJha014
Copy link

@MayankJha014 MayankJha014 commented Dec 7, 2024

What kind of change does this PR introduce?
This PR migrates the test cases in src/screens/UserPortal/Volunteer/Actions from Jest to Vitest, ensuring compatibility with Vitest and maintaining 100% test coverage.

Checklist:

  • Migrated src/screens/UserPortal/Volunteer/Actions Jest test cases to Vitest.
  • Verified all tests pass with npm run test:vitest.
  • Ensured 100% test coverage.

Issue Number:
#2586

Screencast.from.2024-12-06.06-40-40.webm

Summary by CodeRabbit

  • New Features
    • Introduced utility functions for assertions in the test suite, enhancing consistency.
  • Bug Fixes
    • Updated test cases to ensure proper checks for element existence and text content.
  • Chores
    • Transitioned the test suite from Jest to Vitest for improved testing capabilities.
    • Refined coverage collection configurations in testing setup files.

Copy link

coderabbitai bot commented Dec 7, 2024

Walkthrough

The pull request includes updates to the configuration files for testing frameworks, specifically vitest.config.ts and jest.config.js, to refine coverage exclusions. Additionally, the test suite for the Actions component in Actions.spec.tsx has been migrated from Jest to Vitest, including changes to imports, mocking, and assertions. New utility functions have been introduced to standardize assertions across tests.

Changes

File Path Change Summary
vitest.config.ts Updated coverage.exclude to add exclusions for specific test setup files.
jest.config.js Modified collectCoverageFrom to exclude vitest.config.ts and added exclusions for specific test files.
src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx Migrated tests from Jest to Vitest, updated imports, changed mocking, and introduced new utility assertion functions.

Possibly related issues

Possibly related PRs

Suggested labels

refactor, test

Suggested reviewers

  • palisadoes
  • pranshugupta54
  • varshith257

Poem

🐇 In the meadow where tests do play,
We hopped from Jest to Vitest today.
With mocks and asserts, we dance with glee,
A streamlined process, as bright as can be!
So here’s to the changes, both swift and spry,
Let’s test with joy, oh my, oh my! 🌼


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Dec 7, 2024

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (3)
.eslintrc.json (1)

Line range hint 8-14: Update ESLint extends array for Vitest

The configuration still extends Jest recommended configs. For consistency with the Vitest migration:

Update the extends array:

  "extends": [
    "plugin:react/recommended",
    "eslint:recommended",
-   "plugin:jest/recommended",
+   "plugin:vitest/recommended",
    "plugin:prettier/recommended",
    "plugin:@typescript-eslint/recommended",
    "eslint-config-prettier",
    "prettier"
  ],
vitest.config.ts (1)

Line range hint 1-24: Consider completing Jest removal

While the Vitest configuration is properly set up, there are still Jest-related configurations in the project. To complete the migration:

  1. Remove Jest-related dependencies from package.json
  2. Update any remaining Jest ESLint plugins and rules
  3. Update CI/CD configurations if they reference Jest
  4. Consider updating documentation to reflect the migration to Vitest
src/screens/UserPortal/Volunteer/Actions/Actions.test.tsx (1)

112-118: Approve with suggestions for test optimization

The migration to Vitest with waitFor is well-implemented and maintains test coverage. However, consider these optimizations:

  1. Combine related assertions within single waitFor blocks to reduce test execution time:
- await waitFor(async () => {
-   const searchInput = await screen.findByTestId('searchBy');
-   expect(searchInput).toBeInTheDocument();
- });
- await waitFor(async () => {
-   const assigneeName = await screen.findAllByTestId('assigneeName');
-   expect(assigneeName[0]).toHaveTextContent('Teresa Bradley');
- });
+ await waitFor(async () => {
+   const searchInput = await screen.findByTestId('searchBy');
+   const assigneeName = await screen.findAllByTestId('assigneeName');
+   expect(searchInput).toBeInTheDocument();
+   expect(assigneeName[0]).toHaveTextContent('Teresa Bradley');
+ });
  1. Consider extracting the debounce wait time to a constant:
const DEBOUNCE_WAIT_MS = 300;
  1. Make waitFor conditions more specific by using exact text matches where possible:
- await waitFor(() => {
-   expect(screen.getByText(t.actionItemDetails)).toBeInTheDocument();
- });
+ await waitFor(
+   () => {
+     expect(screen.getByText(t.actionItemDetails)).toBeInTheDocument();
+   },
+   {
+     timeout: 2000,
+     interval: 100
+   }
+ );

Also applies to: 123-149, 154-173, 178-197, 223-226, 236-239

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between afa614a and d8fb536.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .eslintrc.json (1 hunks)
  • package.json (2 hunks)
  • src/screens/UserPortal/Volunteer/Actions/Actions.test.tsx (5 hunks)
  • vitest.config.ts (1 hunks)
🔇 Additional comments (4)
package.json (1)

139-139: LGTM: Vitest ESLint plugins are properly configured

The addition of Vitest-related ESLint plugins (@vitest/eslint-plugin, eslint-plugin-vitest, eslint-plugin-vitest-globals) is appropriate for the migration from Jest to Vitest.

Also applies to: 149-150

vitest.config.ts (1)

15-15: LGTM: Test file pattern correctly configured

The test file pattern ['src/**/*.{test,spec}.{js,jsx,ts,tsx}'] appropriately includes both .test and .spec files, which is good for maintaining compatibility with different naming conventions during the migration.

src/screens/UserPortal/Volunteer/Actions/Actions.test.tsx (2)

18-18: LGTM: Proper migration of test setup to Vitest

The migration from Jest to Vitest follows the correct patterns:

  • Imports are properly updated to use Vitest
  • Mocking implementation maintains the same functionality
  • Cleanup is correctly handled with vi.restoreAllMocks()

Also applies to: 68-74, 82-82


Line range hint 1-241: Verify test coverage is maintained after migration

The test suite appears comprehensive, covering all key functionality. Let's verify the coverage metrics are maintained after the migration.

✅ Verification successful

Let me gather more information about the test coverage configuration and implementation.


Let me check the actual test implementation to verify the coverage completeness.


Let me fix the command syntax and try again.


Based on the test implementation analysis, I can now provide the final response:

Test coverage appears complete and well-maintained

The test suite comprehensively covers:

  • Component initialization and rendering
  • Error handling and fallback scenarios
  • User interactions (sorting, searching)
  • Modal operations (open/close)
  • Empty state handling
  • Event handlers (openModal, closeModal)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for the Actions component
# Note: This assumes the coverage report is generated in the standard location

# Search for coverage configuration
echo "Searching for coverage configuration..."
fd -t f -e json -e js -e ts "vitest.config" 

# Search for previous coverage reports to compare
echo "Searching for previous coverage reports..."
fd -t f "coverage-summary.json"

Length of output: 276


Script:

#!/bin/bash
# Check the vitest configuration for coverage settings
echo "Checking vitest configuration..."
cat vitest.config.ts

# Look for test coverage thresholds or related configuration
echo -e "\nSearching for coverage threshold configurations..."
rg -i "coverage|threshold" vitest.config.ts

# Check if there are any other test configuration files
echo -e "\nSearching for other test configurations..."
fd -t f -e js -e ts -e json "test.*config"

Length of output: 1404


Script:

#!/bin/bash
# Check the Actions component implementation to compare with test coverage
echo "Checking Actions component implementation..."
ast-grep --pattern 'export default function Actions' -f src/screens/UserPortal/Volunteer/Actions/Actions.tsx

# Look for any untested event handlers or callbacks
echo -e "\nSearching for event handlers and callbacks..."
rg "const.*=.*=>" src/screens/UserPortal/Volunteer/Actions/Actions.tsx -A 2

# Check for conditional renders that might need testing
echo -e "\nSearching for conditional renders..."
rg "if.*\(.*\).*{|switch.*\(.*\).*{|\?.*:" src/screens/UserPortal/Volunteer/Actions/Actions.tsx

Length of output: 1132


Script:

#!/bin/bash
# Check the Actions component implementation
echo "Checking Actions component implementation..."
ast-grep --pattern 'export default function Actions' src/screens/UserPortal/Volunteer/Actions/Actions.tsx

# Look for conditional renders with fixed regex
echo -e "\nSearching for conditional renders..."
rg "if \(.*\) {|switch \(.*\) {|\? .*:" src/screens/UserPortal/Volunteer/Actions/Actions.tsx

# Check test file for coverage of all handlers
echo -e "\nComparing handlers coverage..."
rg "it\(.*\)" src/screens/UserPortal/Volunteer/Actions/Actions.test.tsx -A 1

Length of output: 1495

.eslintrc.json Outdated Show resolved Hide resolved
vitest.config.ts Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.92%. Comparing base (0630cff) to head (13e123e).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           develop-postgres    #2619       +/-   ##
=====================================================
- Coverage             95.73%   83.92%   -11.82%     
=====================================================
  Files                   295      310       +15     
  Lines                  7036     8105     +1069     
  Branches               1516     1830      +314     
=====================================================
+ Hits                   6736     6802       +66     
- Misses                   99     1164     +1065     
+ Partials                201      139       -62     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@VanshikaSabharwal
Copy link

@MayankJha014 You have to fix the test coverage by following codecav's recommendation.

@VanshikaSabharwal
Copy link

Also follow changes recommended by code rabbit to improve code quality.

@palisadoes
Copy link
Contributor

Please make code rabbit approves your changes

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 9, 2024
Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vitest.config.ts file must be excluded from this PR

vitest.config.ts Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Outside diff range and nitpick comments (3)
src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (3)

79-85: Consider simplifying the mock implementation

While the mock works, it could be simplified for better maintainability.

Consider this simpler implementation:

-    vi.mock('react-router-dom', async () => {
-      const actual = await vi.importActual('react-router-dom');
-      return {
-        ...actual,
-        useNavigate: vi.fn(() => () => {}),
-      };
-    });
+    vi.mock('react-router-dom', () => ({
+      ...vi.importActual('react-router-dom'),
+      useNavigate: () => vi.fn(),
+    }));

Also applies to: 93-93


123-129: Standardize async/await usage with waitFor

There's inconsistency in how async/await is used with waitFor across different test cases. Some use async callbacks while others don't.

Standardize the pattern across all tests. Prefer:

await waitFor(() => {
  // synchronous expectations
});

Instead of:

await waitFor(async () => {
  const element = await screen.findByTestId('...');
  // expectations
});

This makes the code more predictable and easier to maintain.

Also applies to: 165-184, 189-208


134-160: Enhance sorting test assertions

While the test covers basic sorting functionality, it could be more thorough.

Consider adding these assertions:

// Verify the sort button state
expect(sortBtn).toHaveAttribute('aria-expanded', 'true');

// Verify multiple items are sorted correctly
const assigneeNames = await screen.findAllByTestId('assigneeName');
expect(assigneeNames).toHaveLength(expectedLength);
assigneeNames.forEach((name, index) => {
  expectElementToHaveTextContent(name, expectedSortedNames[index]);
});
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 86d5ad9 and a63161d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .eslintrc.json (0 hunks)
  • package.json (2 hunks)
  • src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (6 hunks)
  • vitest.config.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • .eslintrc.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • vitest.config.ts
🔇 Additional comments (3)
package.json (1)

139-139: LGTM: Appropriate Vitest linting dependencies added

The addition of @vitest/eslint-plugin and eslint-plugin-vitest is correct for proper linting support with Vitest.

Also applies to: 149-149

src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (2)

18-18: LGTM: Well-structured utility functions for assertions

The utility functions expectVitestToBeInTheDocument and expectElementToHaveTextContent improve code maintainability by encapsulating common assertions.

Also applies to: 44-53


220-224: LGTM: Adequate error handling coverage

The error handling test cases appropriately verify that error messages are displayed when API calls fail.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 10, 2024
@MayankJha014
Copy link
Author

@palisadoes Sir Please check repo is there any changes required

@VanshikaSabharwal
Copy link

Fix the failing tests @MayankJha014 . Else the PR won't get merged

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (2)
src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (2)

51-60: Consider removing unnecessary utility functions.

These utility functions add an extra layer of abstraction without providing significant benefits:

  1. They wrap simple assertions that are already readable
  2. They make debugging more difficult by adding an extra stack frame
  3. They don't enhance the testing patterns significantly

Consider using direct assertions instead:

// Instead of:
expectVitestToBeInTheDocument(element);
expectElementToHaveTextContent(element, text);

// Use:
expect(element).toBeInTheDocument();
expect(element).toHaveTextContent(text);

Line range hint 1-262: Consider restructuring tests for better organization and maintainability.

While the migration to Vitest is successful, consider these architectural improvements:

  1. Group related tests using nested describe blocks
  2. Extract common setup code into shared fixtures
  3. Add error boundary testing
  4. Add snapshot tests for complex UI states

Example structure:

describe('Actions Component', () => {
  describe('Initialization', () => {
    // URL params tests
    // Loading state tests
    // Error boundary tests
  });

  describe('Data Display', () => {
    // Rendering tests
    // Snapshot tests
  });

  describe('User Interactions', () => {
    describe('Sorting', () => {
      // Sorting tests
    });

    describe('Search', () => {
      // Search tests
    });

    describe('Modals', () => {
      // Modal tests
    });
  });
});
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a63161d and c3a1944.

📒 Files selected for processing (1)
  • src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (7 hunks)

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Outside diff range and nitpick comments (1)
src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (1)

Migration to Vitest is incomplete - Jest dependencies still present

While the test file itself has been migrated to use Vitest syntax, the project still contains Jest dependencies and configuration:

  • Found Jest-related dependencies in package.json:
    • jest, babel-jest, @testing-library/jest-dom, jest-preview, etc.
    • Test script still uses Jest: "test": "cross-env NODE_ENV=test jest --env=./scripts/custom-test-env.js"
    • Jest ESLint plugin: eslint-plugin-jest
  • Test setup files that may contain Jest configuration are present:
    • src/setupTests.ts

The test file migration should be accompanied by:

  1. Updating package.json to remove Jest dependencies
  2. Migrating test scripts to use Vitest
  3. Updating test setup files for Vitest
  4. Removing Jest-specific ESLint configurations
🔗 Analysis chain

Line range hint 1-261: Verify complete removal of Jest dependencies

The migration to Vitest appears complete, but let's verify no Jest-specific code remains.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining Jest-specific code or dependencies

# Search for Jest-specific patterns
echo "Checking for Jest-specific patterns..."
rg -i 'jest\.' src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx
rg -i 'jest\(' src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx
rg -i '\.jest' src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx

# Verify test runner configuration
echo "Checking test configuration..."
rg -l 'jest\.config' .

Length of output: 407


Script:

#!/bin/bash
# Let's perform a more comprehensive check for Jest-related code

# Check for Jest-related imports and dependencies
echo "Checking for Jest-related imports..."
rg -i "from ['|\"]@?jest" src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx

# Check for common Jest assertions and methods
echo "Checking for Jest assertions..."
rg -i "expect\.(.*)(toBe|toEqual|toMatch|toContain|toHaveBeenCalled)" src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx

# Check package.json for Jest dependencies
echo "Checking package.json for Jest dependencies..."
if [ -f "package.json" ]; then
    cat package.json | grep -i "jest"
fi

# Check for any remaining test setup files that might contain Jest configuration
echo "Checking for test setup files..."
fd -t f "(setup|config).*test" .

Length of output: 1159

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3a1944 and 13e123e.

📒 Files selected for processing (1)
  • src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (7 hunks)
🧰 Additional context used
📓 Learnings (1)
src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (2)
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.
Learnt from: adithyanotfound
PR: PalisadoesFoundation/talawa-admin#2482
File: src/components/AddOn/support/components/Action/Action.spec.tsx:1-8
Timestamp: 2024-11-27T06:37:47.871Z
Learning: In the Talawa-Admin project, the `@testing-library/jest-dom` package is imported globally in `vitest.setup.ts`, so individual test files do not need to import it separately.
🔇 Additional comments (4)
src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (4)

25-25: LGTM: Vitest imports correctly added

The necessary Vitest test runners and utilities have been properly imported.


50-61: LGTM: Well-structured test utilities

The mock navigation and utility functions are properly implemented:

  • mockNavigate uses Vitest's vi.fn()
  • Utility functions standardize common assertions

87-93: LGTM: Proper test suite setup with Vitest

The test suite setup correctly:

  • Uses Vitest's module mocking approach
  • Preserves actual router implementation while mocking navigation
  • Includes proper cleanup with vi.restoreAllMocks()

Also applies to: 101-101


131-137: LGTM: Test assertions properly migrated

All test assertions have been successfully migrated to Vitest:

  • Consistent use of utility functions for assertions
  • Proper async handling with waitFor
  • Maintains original test coverage and behavior

Also applies to: 142-168, 173-192, 197-216, 223-224, 232-232, 242-245, 255-258

@palisadoes
Copy link
Contributor

@varshith257 Please review. Some sensitive files were edited that you should investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants