atlp-rwanda / dynamites-ecomm-fe

https://dynamites-ecomm-fe.netlify.app/
0 stars 0 forks source link

Set Up Testing for project #17

Closed niyobern closed 3 weeks ago

niyobern commented 3 weeks ago

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:

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

vercel[bot] commented 3 weeks ago

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 commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.