Los-Terremotos / GreenPets

GreenPets is an innovative platform designed for plant lovers and aspiring plant parents. This unique tool helps users find the perfect plants that suit their lifestyle and expertise level.
https://greenpets.netlify.app/
2 stars 0 forks source link

18/FS-Unit_Testing #123

Closed KP824 closed 7 months ago

KP824 commented 7 months ago

Overview

task-name Unit tests for Navbar component

Description Created unit tests to validate functionality of the Navbar component.

Test cases include:

  1. Validating existence of buttons
  2. Validating clicking on each button will toggle scrolling positions to respective sections
  3. Clicking on the Surprise? button will trigger a change in state for the theme of the landing page
  4. Clicking on the Get Started button will reroute the user to the /get-started page
  5. Verify the visibility of the Navbar, based on the position of the ScrollY value (invisible if < 150px, otherwise visible)

Ticket Item

18

Steps to Reproduce Bug / Validate Feature / Confirm Tech Debt Fix

  1. Go to client folder, cd client
  2. Run npm install
  3. Run test script npm run test __tests__/Navbar.test.tsx

Previous behavior No unit tests for Navbar component

Expected behavior All tests should be passing for Navbar.tsx

Screenshots & Videos Screenshot 2024-04-24 at 2 44 39 PM

Additional context Check testing_notes for details on approach.