Add comprehensive test suite infrastructure

- Create backend xUnit test project with Moq and FluentAssertions
- Add test utilities: TestDataFactory, MockHttpContext, TestUserClaims
- Create AuthControllerTests with comprehensive auth scenarios
- Install Jest and React Testing Library for frontend
- Configure jest.config.ts and jest.setup.ts with Next.js support
- Add test scripts to package.json
This commit is contained in:
Denis Urs Rudolph
2026-04-05 22:16:44 +02:00
parent 32bfbcadb1
commit 571fe5bc7c
19 changed files with 11224 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
## Why
The RacePlanner project currently lacks a comprehensive test suite, making it difficult to ensure code quality and prevent regressions. We need to establish testing infrastructure for both the .NET backend and Next.js frontend to enable confident development and deployments.
## What Changes
- **Backend Unit Tests**: Create a .NET test project with xUnit for unit testing Controllers, Services, and Data layer
- **Frontend Unit Tests**: Set up Jest/React Testing Library for React components and hooks
- **Integration Tests**: Create end-to-end integration tests that verify frontend-backend communication via API calls
- **Test Automation**: Configure test runners with npm scripts for automated execution
- **CI/CD Integration**: Add GitHub Actions workflow to run tests on pull requests
## Capabilities
### New Capabilities
- `backend-unit-tests`: .NET xUnit test project for API Controllers, Services, and Data layer
- `frontend-unit-tests`: Jest/React Testing Library setup for Next.js components and hooks
- `integration-tests`: End-to-end tests verifying API communication between frontend and backend
- `test-automation`: Automated test runners and CI/CD integration
### Modified Capabilities
- None (this change adds testing infrastructure without modifying existing functionality)
## Impact
- **Backend**: New `backend.Tests/` project directory added, new test dependencies in `.csproj`
- **Frontend**: Additional dev dependencies for Jest and React Testing Library
- **CI/CD**: New GitHub Actions workflow in `.github/workflows/` for automated testing
- **Build Process**: New npm scripts (`test`, `test:backend`, `test:frontend`, `test:integration`) added