- Project: VerifyWise
- Repository: https://verifywise.ai/
- Version: 1.0
This document defines the automated testing approach for the frontend application using Jest, React Testing Library, User Event (and related tooling) for unit and integration tests and Playwright to E2E tests. It describes what will be tested, how tests will be organized, quality gates, and how tests run in CI.
- Unit tests for:
- Utility functions
- Hooks
- State management logic (reducers/selectors)
- Data transformation and validation logic
- Component tests for:
- UI components (rendering, props, conditional states)
- User interactions (click, type, submit, navigation)
- Error and loading states
- Integration tests for:
- Feature flows across multiple components
- API interactions (mocked)
- Form validation + submission flows
- End-to-end tests for:
- User access the application
- Authentication flow (login/logout)
- Navigation between routes and protected routes
- Core features flow
- Cross-browser/device testing
- Performance/load testing
- Backend and infrastructure testing
- Unit: isolated tests, no DOM if possible
- Component: React Testing Library (RTL), user-event
- Integration: RTL + mocked API layer, verifies feature flows
- Test behavior, not implementation details.
- Keep tests deterministic: no real network, no real time unless controlled.
- Minimize snapshots; use them only for stable UI output.
- Tests will be done inside each folder to facilitate the visualization of each file tested
- Test Runner: Jest
- UI Testing: React Testing Library + @testing-library/user-event
- API Mocking: MSW (preferred) or jest mocks
- Coverage: Jest coverage reports
- Optional: jest-axe for accessibility checks
- Use MSW to mock API at the network level for component/integration tests.
- Unit tests may mock modules directly using
jest.mock()when appropriate.
- ComponentName.test.tsx
- Overall thresholds:
- Statements: 80%
- Functions: 80%
- Lines: 80%
- TODO all implementations bellow after tests be runnning;
- Tests run on:
- Pull requests (required)
- Main branch merges
- Commands:
test(fast feedback)test:ci(coverage + reporting)
- Artifacts:
- Coverage summary
TEST_PLAN.md(this document)- Coverage report in CI
- Test results summary in PR checks