Updated Tests
This commit is contained in:
7
TESTS.md
7
TESTS.md
@@ -27,7 +27,6 @@ stateDiagram-v2
|
|||||||
- Mock IHttpClientFactory with TestHttpMessageHandler to control image URL reachability; avoid real network.
|
- 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.
|
- 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.
|
- 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)
|
## Test Cases (ordered by feature)
|
||||||
|
|
||||||
@@ -84,12 +83,6 @@ stateDiagram-v2
|
|||||||
- Global exception handler returns 500 with JSON body and logs error.
|
- Global exception handler returns 500 with JSON body and logs error.
|
||||||
- /health returns {status:"ok"}.
|
- /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 caller’s own vote.
|
|
||||||
|
|
||||||
## Execution Notes
|
## Execution Notes
|
||||||
- Use named test data builders for players/suggestions to keep cases small and isolated.
|
- 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.
|
- Reset in-memory DB per test to avoid cross-contamination; assert timestamps using time providers or approximate windows.
|
||||||
|
|||||||
Reference in New Issue
Block a user