Skip to content

test(client): add Vitest and React Testing Library setup#675

Open
NishaKhandelwal wants to merge 1 commit into
parthbuilds-community:mainfrom
NishaKhandelwal:frontend-testing
Open

test(client): add Vitest and React Testing Library setup#675
NishaKhandelwal wants to merge 1 commit into
parthbuilds-community:mainfrom
NishaKhandelwal:frontend-testing

Conversation

@NishaKhandelwal

Copy link
Copy Markdown

📋 What does this PR do?

This PR sets up frontend testing for the FitMart client using Vitest and React Testing Library.

Changes made:

  • Configured Vitest for the Vite React application.

  • Added a global test setup file (src/test/setup.js).

  • Added utility tests for:

    • healthUtils
    • normalizeProduct
  • Added an initial render test for the FitnessChatBot component.

  • Updated the GitHub Actions CI workflow to execute frontend tests during pull requests.

Note: While setting up the testing environment, I encountered dependency version conflicts in the existing project (@eslint/js and @vitejs/plugin-react) that prevented a clean installation. I updated those dependency versions locally so the project could install successfully and the testing setup could be implemented.


🔗 Related Issue

Closes #


🧪 How was this tested?

  • Installed project dependencies successfully.
  • Ran the frontend test suite locally using:
npm test
  • Verified that all tests pass successfully.
  • Confirmed that the GitHub Actions workflow includes the frontend test step.

📸 Screenshots (if UI changes)

No UI changes were made.


✅ Checklist

  • I've read the CONTRIBUTING guide
  • My code follows the project's style guidelines
  • I've tested my changes locally
  • I've linked the related issue
  • I haven't introduced any new secrets or API keys

@github-actions github-actions Bot added bug Something isn't working enhancement New feature or request refactor Improve code without changing functionality UI UI-related improvements including layouts, responsiveness, styling, animations, and UX enhancements. frontend devops labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working devops enhancement New feature or request frontend refactor Improve code without changing functionality UI UI-related improvements including layouts, responsiveness, styling, animations, and UX enhancements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant