test(worker): Account — fill gaps + lifecycle test
This commit is contained in:
@@ -311,3 +311,19 @@ Guaranteed behaviors:
|
||||
`"Kan de export niet openen"` when the response is not ok.
|
||||
- Lifecycle (`src/screens/History.test.tsx`): the list renders a completed session showing both its
|
||||
worked duration and its `Pauze` line, then the export action invokes the download path.
|
||||
|
||||
## Account — worker client
|
||||
|
||||
Src covered (worker `apps/worker`): `src/screens/Account.tsx` — 100% stmts/branch/funcs/lines.
|
||||
No `c8 ignore`s needed.
|
||||
|
||||
Guaranteed behaviors:
|
||||
|
||||
- Account renders the Dutch header (`Account`) and, once `GET /api/me` resolves, shows the signed-in
|
||||
user's name and email from `useMe()`.
|
||||
- The fallback message `Kon accountgegevens niet laden.` shows when the query resolves without a
|
||||
`user` (and the name/email are then absent).
|
||||
- Clicking `Uitloggen` calls `signOut`, which clears the stored bearer token.
|
||||
- Lifecycle (`src/screens/Account.test.tsx`): from the authenticated app on the Account screen,
|
||||
clicking `Uitloggen` flips the auth context to unauthenticated so the login form
|
||||
(`E-mailadres`) renders and the `Uitloggen` button is gone (token cleared).
|
||||
|
||||
Reference in New Issue
Block a user