data.e2e's account delete fails on a database with no other admin #287

Open
opened 2026-11-18 13:38:21 +00:00 by chris-kreidl · 0 comments
chris-kreidl commented 2026-11-18 13:38:21 +00:00 (Migrated from github.com)

Every e2e user is created as an admin (e2e/support/test-user.ts). On a freshly reset dev database there's no owner account, so data.e2e.ts's user is the only admin, and "Delete everything" is refused by the last-admin guard (#88): "This is the last admin. Make someone else an admin first." The flow passes only when the database already holds another admin (after db:pull). CI doesn't run Playwright, so nobody saw it.

Fix: let testUser create a plain user, and use that in data.e2e.ts. Deleting your own account is a user's flow anyway.

Every e2e user is created as an admin (`e2e/support/test-user.ts`). On a freshly reset dev database there's no owner account, so `data.e2e.ts`'s user is the only admin, and "Delete everything" is refused by the last-admin guard (#88): "This is the last admin. Make someone else an admin first." The flow passes only when the database already holds another admin (after `db:pull`). CI doesn't run Playwright, so nobody saw it. Fix: let `testUser` create a plain `user`, and use that in `data.e2e.ts`. Deleting your own account is a user's flow anyway.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ckreidl/trainer#287
No description provided.