fix(e2e/ui): match the 409 duplicate-user status in the ensure fallback

/user/new raises 409 for an existing user, not 400, so the update fallback
was unreachable and any rerun against an already-seeded DB would fail setup.
Accept either status and let the already-exists body check discriminate
This commit is contained in:
ryan-crabbe-berri 2026-07-28 11:07:50 -07:00
parent 462f3d8435
commit 39e2b6d0ad

View file

@ -24,7 +24,7 @@ async function ensureDbRoleUser(
});
if (created.ok()) return;
const body = await created.text();
if (created.status() === 400 && body.includes("already exists")) {
if ((created.status() === 409 || created.status() === 400) && body.includes("already exists")) {
const updated = await api.post(`${baseUrl}/user/update`, {
headers: auth,
data: { user_id: entry.userId, user_role: entry.dbRole, password },