From b700ae00799e8ed70f9b992d70fa43478e992594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 16 Jun 2026 17:00:05 +0200 Subject: [PATCH] test(e2e): opt the seed account into cycle tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v1.18.0 resolves the cycle module through isCycleEnabled(gender, CycleProfile): a NULL cycleTrackingEnabled derives from gender, so the MALE-seeded e2e account read as cycle-OFF and /cycle redirected home — the cycle-wheel tile never mounted. Seed a CycleProfile with cycle_tracking_enabled = true so the cycle vertical renders for the mobile smoke spec. --- e2e/setup/global-setup.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/e2e/setup/global-setup.ts b/e2e/setup/global-setup.ts index af5dc2844..6f9d7f854 100644 --- a/e2e/setup/global-setup.ts +++ b/e2e/setup/global-setup.ts @@ -141,6 +141,26 @@ export default async function globalSetup(config: FullConfig): Promise { ], ); + // Opt the seed account into cycle tracking. The user is seeded as + // `MALE`, and v1.18.0 resolves the `cycle` module through + // `isCycleEnabled(gender, CycleProfile)` — NULL `cycleTrackingEnabled` + // derives from gender, so a male account with no profile reads as + // cycle-OFF and `/cycle` redirects home. An explicit `true` opts the + // account in regardless of gender, which is what the cycle spec needs. + // Keyed by the username subquery so we never depend on the cuid above + // (the user upsert may have hit the ON CONFLICT path on a re-run). + await pool.query( + `INSERT INTO cycle_profiles + (id, user_id, cycle_tracking_enabled, created_at, updated_at) + SELECT $1, u.id, true, $2, $2 + FROM users u + WHERE u.username = $3 + ON CONFLICT (user_id) DO UPDATE SET + cycle_tracking_enabled = true, + updated_at = EXCLUDED.updated_at`, + [cuid(), now, E2E_USER.username], + ); + // Console (instead of structured logging) is intentional here — // global-setup runs outside the app's logging context, and the // line is useful when debugging a CI failure where the seed didn't