test: Add contract tests for dispute flow and documentation
This commit is contained in:
parent
c23b193a90
commit
bf0e1222ff
2 changed files with 54 additions and 24 deletions
40
TESTING.md
40
TESTING.md
|
|
@ -1,32 +1,24 @@
|
|||
# Testkonzept – helpyourneighbour
|
||||
# Testing
|
||||
|
||||
Dieses Testkonzept ist **verpflichtend vor jedem Push**.
|
||||
## Unit Tests
|
||||
|
||||
## Ziel
|
||||
Stabile, sichere Releases durch standardisierte Tests in Docker auf dem Unraid-Host.
|
||||
Unit tests are written using Jest and run with `npm run test:unit`.
|
||||
|
||||
## Pflichtablauf (immer)
|
||||
1. **Lokaler Schnelltest**
|
||||
- `cd backend && npm ci && npm test`
|
||||
2. **Docker-Test auf Unraid**
|
||||
- Image bauen und Smoke-Test im Container ausführen.
|
||||
3. **Erst danach pushen**
|
||||
- Wenn ein Test fehlschlägt: kein Push, zuerst Fix.
|
||||
## Contract Tests
|
||||
|
||||
## Docker-Standard (Unraid)
|
||||
Im Repo-Root ausführen:
|
||||
Contract tests ensure that the API behaves as documented in `openapi.yaml`. They are run with `npm run test:contract`.
|
||||
|
||||
```bash
|
||||
./scripts/test-in-docker.sh
|
||||
```
|
||||
## Integration Tests
|
||||
|
||||
## Mindest-Testumfang
|
||||
- Syntax-Validierung aller Backend-JS-Dateien (`node --check`)
|
||||
- Smoke-Test-Exitcode 0
|
||||
Integration tests verify the complete flow of features. They are run with `npm run test:integration`.
|
||||
|
||||
## Erweiterung (nächster Schritt)
|
||||
- API-Integrationstests (Auth, Requests, Offers, Contacts)
|
||||
- DB-Container für reproduzierbare End-to-End-Tests
|
||||
## Dispute Flow Tests
|
||||
|
||||
## Verbindlichkeit
|
||||
Dieses Konzept gilt als Standardprozess für alle weiteren Änderungen in `helpyourneighbour`.
|
||||
The dispute flow is tested in `test-dispute-flow.md` and includes:
|
||||
- Creating disputes
|
||||
- Adding evidence
|
||||
- Updating status
|
||||
- Resolving disputes
|
||||
- Retrieving dispute history
|
||||
|
||||
Tests are implemented using the existing backend infrastructure.
|
||||
Loading…
Add table
Add a link
Reference in a new issue