e2e: fix Detox suite drift, run against local Worker + local D1

Merged
TP
8d ago
+2191-921

Consolidated local-first E2E: supersedes #102 (its seedHelpers.js is included byte-identical, plus a Nova Lite vision row in the seed SQL).

What changed (13 files):

  • front/e2e: 9 specs rewritten around shared REST+D1 helpers (selection injection instead of dead e2eInitialRoute, back-button nav + manual asserts, per-spec self-seeding, timestamped topics)
  • front/e2e/seedHelpers.js: three-way helpers — local wrangler dev via wrangler d1 execute --local, workers.dev via D1 REST, Django via seed-command hints
  • worker/scripts/seed-local-e2e.sql: local-D1 seed (users 60/61, PIN-less accounts, Nova Micro default + Nova Lite vision)
  • front/app/botChat.tsx: e2e image branch resolves a bundled asset to a simulator-local file URI (remote-URL uploads always fail over XHR)
  • front/app/onboarding/WizardStep.tsx: default export silences the dev-warning banner that covered the onboarding CTA

Local runbook (zero Cloudflare traffic):
Terminal 1: copy worker/ aside if needed, add gitignored .dev.vars (JWT_SECRET + AWS/Tavily), npx wrangler dev --port 8787, d1 migrations apply syft-db --local, d1 execute syft-db --local --file=./scripts/seed-local-e2e.sql
Terminal 2: API_BASE_URL=http://127.0.0.1:8787/api npx detox test -c ios.sim.debug

Verification: full suite 22/22 green in one run on local stack (127.0.0.1:8787 + iPhone 16 Pro sim). No deploys, no live-D1 traffic, no secrets committed.


Summary by cubic

Consolidates the Detox E2E suite to run entirely against a local Worker + local D1, so tests require no live Cloudflare traffic or Django backend. All nine specs now self-seed using shared REST/D1 helpers and verify against the real API.

Key changes

  • Added front/e2e/seedHelpers.js with three-way seeding (local wrangler d1 execute --local, workers.dev REST, and Django seed hints) and ported all specs to it.
  • Added worker/scripts/seed-local-e2e.sql seeding the two E2E users and the Nova Lite vision model; ON CONFLICT upserts preserve FK state, and reseeds converge to Nova Micro as default with Nova Lite non-default.
  • In e2e mode, botChat.tsx uploads a bundled asset as a simulator-local file:// URI instead of a remote URL, which always failed; added expo-asset as a dependency.
  • Moved WizardStep.tsx from app/onboarding/ to components/onboarding/ to get it out of the route tree and stop the dev-warning banner from covering the onboarding CTA.
  • Extended the e2e eslint override to all e2e/*.js (fixes 17 no-undef errors) and disabled expo/no-dynamic-env-var for computed env reads.
  • Fixed spec drift: PIN lockout reset, 15s settle after D1 seeding, API-based user-echo polling, timestamped topics, and gating D1-only setup behind isWorkerBase for Django compatibility.
  • Reset the usage quota after 06's warm-up so a seeded account stays under the daily cap, and hardened 04's transcript proof (normalized unwrapped inbox arrays, message-count subtitle plus mounted list).