Skip to content

feat(e2e): Firebase-emulator cloud project — 34 infra-gated cases now real passing tests#829

Merged
MrCoder merged 1 commit into
masterfrom
feat/e2e-cloud-emulator
Jun 18, 2026
Merged

feat(e2e): Firebase-emulator cloud project — 34 infra-gated cases now real passing tests#829
MrCoder merged 1 commit into
masterfrom
feat/e2e-cloud-emulator

Conversation

@MrCoder

@MrCoder MrCoder commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Stands up a Firebase-emulator-backed e2e project (cloud) and converts 34 of the 35 cloud.fixme stubs into real passing tests — unlocking the AUTH/CLOUD/PADDLE coverage the gap plan deferred.

Infra

  • firebase.json — adds the auth emulator (:9099); existing ports kept (emulators block is deploy-ignored).
  • web/src/services/firebase.ts — emulator-connect (auth+firestore) gated on VITE_USE_EMULATOR === '1'; unset in every prod/staging build → dead-code-eliminated (verified: none of it appears in web/dist). Functions need no client change (same-origin fetch + existing vite proxy).
  • playwright.config.js — a cloud project (PW_CLOUD=1) that boots the emulators (via functions/node_modules/.bin/firebase v13 — the global v9 can't run the functions emulator) + an emulator-wired dev server, running only the cloud specs. The default chromium project testIgnores the cloud specs (verified: 0 collected) — the staging gate is unaffected.
  • e2e/cloud/* (Firestore REST seed/probe + global wipe), e2e/tests/helpers/cloud.js (deterministic emulator sign-in via unsigned custom token), package.json test:e2e:cloud, updated EMULATOR_SETUP.md.
  • .gitignore — excludes functions/package-lock.json (do not alter the prod functions deploy).

Coverage: 34 real passing tests, 1 fixme

  • Live & passing: AUTH-1..6, IOL-1/2/3, FLD-1/3/4/5, SHR-1..8 + EMB-1 (real create_share/get_shared_item functions-emulator round-trips), SUB-2/3/4/5 (Paddle via the window.Paddle mock seam), PST-2/3/4, HDR-4/6, NET-2, SET-7, CSS-5. Firestore side-effects probed via an admin REST seam.
  • Still fixme (1): FLD-2 — no move-to-folder UI in the hub (a product gap, not infra; documented with the un-fixme recipe).

Validation

  • PW_CLOUD=1 playwright test --project=cloud34 passed, 1 skipped, 0 failed (~1.1m) — re-run independently.
  • pnpm -C web typecheck clean; default smoke green; prod bundle confirmed emulator-free.
  • No prod release needed (no runtime change). Run locally with yarn test:e2e:cloud.

…d cases now live (34 pass, 1 fixme)

Stand up a Firebase Emulator Suite (auth+firestore+functions) and a dedicated
Playwright 'cloud' project, unlocking the AUTH/CLOUD/PADDLE gap cases that the
signed-out staging gate cannot reach.

- firebase.json: add auth emulator (:9099); keep existing ports.
- web/src/services/firebase.ts: emulator wiring GATED on VITE_USE_EMULATOR (prod
  bundle verified clean — dead-code-eliminated when unset). Deterministic popup-free
  sign-in via unsigned custom token (emulator skips signature verify) + window.__e2eSignIn
  / __e2eForceAuthError dev hooks.
- e2e/cloud/firestoreEmu.mjs: zero-dep Firestore REST seed/probe (Bearer owner admin
  bypass). e2e/cloud/globalSetup.mjs: wipe emulators before each cloud run.
- playwright.config.js: 'cloud' project (PW_CLOUD=1) runs ONLY cloud specs via a
  separate emulator+dev webServer; default chromium project testIgnores them.
- Uses functions/node_modules firebase-tools v13 (global v9 CLI's pkg'd Node can't
  parse firebase-admin@11 optional chaining → functions emulator crash).
- cloud.spec.js: 34 real tests (AUTH/IOL/FLD/SHR/SUB/PST/HDR/EMB/NET/SET/CSS) green.
  cloud.fixme.spec.js: FLD-2 stays fixme — blocked by missing DiagramCard move-to-folder
  UI, not infra.

Validation: cloud 34 passed / 1 skipped; web typecheck clean; default smoke 3 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaTcJeuioVJaqvH8ULCaY6
@MrCoder MrCoder merged commit c2cb5d0 into master Jun 18, 2026
4 checks passed
@MrCoder MrCoder deleted the feat/e2e-cloud-emulator branch June 18, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant