test(e2e): close coverage gaps — mutation flows, profile, admin #48
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
A login regression (commit
8f5c13f) was not caught by the E2E suite because the tests were never enforced before push. The bug —handleFetchreturning 401 when noauth_tokencookie was present, blocking the login action's own credential-validation request — would have been caught immediately byauth.spec.tshad the suite been run. The fix: add a pre-push hook (see companion commit).A full audit of the app against the existing E2E specs also revealed significant gaps in mutation flows, the profile feature, and the new admin routes.
Coverage gaps
Auth
login(), make an authenticated API call (e.g.GET /api/users/me) and assert200 OK. Currentlyauth.spec.tsonly checks the URL changed to/; a broken cookie would still pass that assertion.Documents
Persons
Profile
/profile, assert own username/fields are shownAdmin
/admin, assert the three tabs (Benutzer, Gruppen, Schlagworte) are visible/admin/users/new— fill all fields, submit, assert redirect and new user appears in the list/admin/users/[id]— change a profile field, save, assert success messagePermissions
Notes
afterEach.auth.setup.tssession trick already shows the right pattern for re-using login state; mutation tests should build on that.