Updated Tests

This commit is contained in:
2026-02-05 17:55:12 +01:00
parent bde0efc811
commit 330d87b432

View File

@@ -27,7 +27,6 @@ stateDiagram-v2
- Mock IHttpClientFactory with TestHttpMessageHandler to control image URL reachability; avoid real network.
- Helper builders: `TestServerClient` to act as specific user (cookie auth), `SeedData` for players/suggestions/votes, `PhaseHelper` to set phases/resultsOpen directly in DB.
- Run migrations once per test suite against in-memory DB to mirror schema.
- UI smoke (optional): Playwright hitting dev server with seeded DB to cover language toggle, auth, phase transitions, vote slider/link UI.
## Test Cases (ordered by feature)
@@ -84,12 +83,6 @@ stateDiagram-v2
- Global exception handler returns 500 with JSON body and logs error.
- /health returns {status:"ok"}.
### 8) Frontend Smoke (optional but for full app confidence)
- Auth flow toggles between login/register, form validation max lengths enforced in DOM.
- Suggest flow: add up to 5, edit/delete, lock title after moving to Vote, card renders metadata, language toggle persists.
- Vote flow: displays all suggestions with authors, slider updates badge, finalize disables inputs, missing votes warning appears, admin link/unlink controls visible only to admins.
- Results view: only after resultsOpen, shows leaderboard sorted by average, linked titles display, shows callers own vote.
## Execution Notes
- Use named test data builders for players/suggestions to keep cases small and isolated.
- Reset in-memory DB per test to avoid cross-contamination; assert timestamps using time providers or approximate windows.