feat(e2e): Firebase-emulator cloud project — 34 infra-gated cases now real passing tests#829
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stands up a Firebase-emulator-backed e2e project (
cloud) and converts 34 of the 35cloud.fixmestubs 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 onVITE_USE_EMULATOR === '1'; unset in every prod/staging build → dead-code-eliminated (verified: none of it appears inweb/dist). Functions need no client change (same-origin fetch + existing vite proxy).playwright.config.js— acloudproject (PW_CLOUD=1) that boots the emulators (viafunctions/node_modules/.bin/firebasev13 — the global v9 can't run the functions emulator) + an emulator-wired dev server, running only the cloud specs. The defaultchromiumprojecttestIgnores 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.jsontest:e2e:cloud, updatedEMULATOR_SETUP.md..gitignore— excludesfunctions/package-lock.json(do not alter the prod functions deploy).Coverage: 34 real passing tests, 1 fixme
create_share/get_shared_itemfunctions-emulator round-trips), SUB-2/3/4/5 (Paddle via thewindow.Paddlemock seam), PST-2/3/4, HDR-4/6, NET-2, SET-7, CSS-5. Firestore side-effects probed via an admin REST seam.Validation
PW_CLOUD=1 playwright test --project=cloud→ 34 passed, 1 skipped, 0 failed (~1.1m) — re-run independently.pnpm -C web typecheckclean; defaultsmokegreen; prod bundle confirmed emulator-free.yarn test:e2e:cloud.