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

Set Up Testing for project #17

Closed
wants to merge 3 commits into from
Closed

Set Up Testing for project #17

wants to merge 3 commits into from

Conversation

niyobern
Copy link
Contributor

@niyobern niyobern commented Jun 6, 2024

Description:

This PR introduces testing setup for our Vite + React + TypeScript project. The goal is to ensure that our components and business logic function as expected, and to catch any potential issues before they reach production.

Changes:

  • Installed vitest and @testing-library/react as dev dependencies.
  • Created a test file App.test.tsx for the App component.
  • Wrote a test case to check if the App component renders the expected content.

Test:

The test checks if the App component renders a paragraph with the text 'Welcome to Dynamites E-commerce'. This is done by rendering the App component and then using screen.getByRole('paragraph') to find the paragraph element. The toHaveTextContent assertion is then used to check if the paragraph contains the expected text.

Impact:

This change doesn't affect the existing functionality of the application but provides a foundation for writing more comprehensive tests in the future. This will help us ensure the quality and reliability of our application as we continue to develop and add new features.

How to Test:

After pulling the changes, run

npm run test

to test the App component

Copy link

vercel bot commented Jun 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dynamites-ecomm-fe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 2:51pm

@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 17.24%. Comparing base (1d4ea43) to head (48e241f).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #17   +/-   ##
========================================
  Coverage    17.24%   17.24%           
========================================
  Files            4        4           
  Lines           29       29           
  Branches         4        4           
========================================
  Hits             5        5           
  Misses          21       21           
  Partials         3        3           

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

vite.config.ts Outdated Show resolved Hide resolved
@niyobern niyobern added the Ready for TTL Review the PR is ready to be reviewed by the TTL/Manager label Jun 7, 2024
public/vite.svg Outdated Show resolved Hide resolved
src/assets/react.svg Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Front-End Ready for TTL Review the PR is ready to be reviewed by the TTL/Manager WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up testing for our ecommerce frontend
6 participants