Skip to content

First testing for frontend#2

Open
Danielpachecou wants to merge 4 commits intotheocr301:mainfrom
ryannerby:First-testing-for-frontend
Open

First testing for frontend#2
Danielpachecou wants to merge 4 commits intotheocr301:mainfrom
ryannerby:First-testing-for-frontend

Conversation

@Danielpachecou
Copy link
Copy Markdown

Hey @ryan! 👋

✅ What's Included
Frontend Testing Setup & Initial Tests:

  • Configured Jest and React Testing Library for the client (frontend)
  • Added Babel and JSDOM configuration so Jest can handle JSX and browser APIs
  • Added setup for handling CSS imports in Jest tests
  • Created unit tests for:
    • CarForm: rendering fields, validation on submit, and calling onAddCar
    • CarHistory: loading state, error handling, and rendering fetched car data (using mocked fetch)
    • CarItem: rendering car information and verifying the history link

📁 Key Files Added/Modified

  • client/jest.config.js
  • client/babel.config.js
  • client/setupTests.js
  • client/mocks/styleMock.js
  • client/src/components/tests/CarForm.test.jsx
  • client/src/components/tests/CarHistory.test.jsx
  • client/src/components/tests/CarItem.test.jsx

Day 1 – Frontend Testing Environment Ready ✅

Ryan Nerby and others added 3 commits August 1, 2025 13:51
- Add Jest and Supertest for testing
- Configure separate test database environment
- Create unit tests for Car model
- Create integration tests for /cars GET and POST endpoints
- All tests passing (5/5)
- Test database automatically cleans up after each test

Day 1 - Testing Infrastructure Complete ✅
🧪 Day 1 - Testing Infrastructure Complete
@Danielpachecou
Copy link
Copy Markdown
Author

@ryannerby

Copy link
Copy Markdown

@ryannerby ryannerby left a comment

Choose a reason for hiding this comment

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

Nice work bro! Comments are in Spanish, but the tests look great 👍

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.

2 participants