test: Firebase mock harness + createCampaign characterization

- src/__mocks__/firebase/*: jest manual mocks (app/auth/firestore)
- src/__mocks__/firebase/_mock-db.js: in-memory DB + call recorder
- src/setupTests.js: jest-dom, env stubs, crypto polyfill, DB reset
- src/App.characterization.test.js: createCampaign -> setDoc path/payload locked
- src/storage/contract.js (renamed from .test.js, helper not suite)

21 tests green (memory 19 + createCampaign 2).
This commit is contained in:
david raistrick
2026-06-28 17:59:50 -04:00
parent 12b24eb707
commit 84dd17e174
8 changed files with 273 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
// jest manual mock: firebase/app
const fakeApp = { name: '[fake-firebase-app]', options: {} };
export function initializeApp(config) { return fakeApp; }
export const getApp = () => fakeApp;
export const getApps = () => [fakeApp];