This project includes comprehensive testing across different levels:
- Framework: Vitest
- Purpose: Test individual functions and components in isolation
- Run:
npm run test:unit
- Framework: Vitest + React Testing Library
- Purpose: Test how different modules work together
- Run:
npm run test:integration
- Framework: Playwright
- Purpose: Test individual components in a browser environment
- Run:
npm run test:component
- Framework: Playwright
- Purpose: Test complete user workflows
- Run:
npm run test:e2e
Make sure you have all dependencies installed:
npm install# Unit tests (fastest)
npm run test:unit
# Integration tests
npm run test:integration
# Component tests (requires browser)
npm run test:component
# E2E tests (requires development server)
npm run test:e2enpm run test:all# This will start the dev server and run E2E tests
npm run dev:test- Start the development server:
npm run dev
- In another terminal, run E2E tests:
npm run test:e2e
- Track validation logic
- Utility functions
- Business logic
- Search functionality integration
- API calls with state management
- Filter combinations
- Pagination integration
- SearchInput component behavior
- User interactions
- Accessibility features
- Responsive design
- Complete user workflows
- Create, edit, delete tracks
- Search and filtering
- Pagination
- Error handling
- Responsive design
- Keyboard navigation
If E2E tests fail with connection errors:
- Make sure your development server is running on
http://localhost:3000 - Check that the server is accessible
- The tests will automatically skip if the server is not available
If component tests fail:
- Make sure Playwright browsers are installed:
npx playwright install - Check that the development server is running
If integration tests fail:
- Make sure all dependencies are installed
- Check that the test environment is properly configured
src/tests/
├── unit/ # Unit tests (Vitest)
├── integration/ # Integration tests (Vitest)
├── component/ # Component tests (Playwright)
└── e2e/ # End-to-end tests (Playwright)
- Unit Tests: Test individual functions and logic
- Integration Tests: Test module interactions
- Component Tests: Test UI components in isolation
- E2E Tests: Test complete user workflows
The tests are designed to run in CI/CD environments:
- Unit and integration tests run quickly
- Component tests run in headless browsers
- E2E tests can be configured to run against staging environments