(uid: string, name: string)
| 69 | // ─── User operations ────────────────────────────────────────────────────────── |
| 70 | |
| 71 | async function createUser(uid: string, name: string): Promise<void> { |
| 72 | // Use PUT (upsert) — creates if not exists, updates if exists. |
| 73 | // This avoids 400 errors when users already exist from a previous run |
| 74 | // where permanent deletion wasn't supported. |
| 75 | await apiCall('PUT', `/users/${uid}`, { |
| 76 | name, |
| 77 | tags: [E2E_TAG], |
| 78 | deactivated: false, // reactivate if previously deactivated |
| 79 | }); |
| 80 | } |
| 81 | |
| 82 | async function deleteUserPermanently(uid: string): Promise<void> { |
| 83 | // Try permanent delete first; if not supported by the plan, deactivate instead |
no test coverage detected