test: logs + deathSave characterization (6 tests)
- Logs.characterization.test.js: logAction (write + undo payload), clearLogs batch delete, undo (updateDoc encounter + mark undone), deathSave increment + isDying - mock firestore getDocs: return .ref.path on docs (batch.delete support) - mock addDoc: record full doc path not collection path All write sites characterized. 56 frontend tests green.
This commit is contained in:
@@ -35,7 +35,7 @@ export async function deleteDoc(docRef) {
|
||||
export async function addDoc(collRef, data) {
|
||||
const id = `auto_${MOCK_DB.nextId()}`;
|
||||
const path = `${collRef.path}/${id}`;
|
||||
recordCall({ fn: 'addDoc', path: collRef.path, data: clone(data) });
|
||||
recordCall({ fn: 'addDoc', path, data: clone(data) });
|
||||
MOCK_DB.set(path, clone(data));
|
||||
return { id, path };
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export async function getDoc(docRef) {
|
||||
export async function getDocs(collRefOrQuery) {
|
||||
const collPath = collRefOrQuery.ref ? collRefOrQuery.ref.path : collRefOrQuery.path;
|
||||
const docs = MOCK_DB.collection(collPath);
|
||||
return { docs: docs.map(d => ({ id: d.id, data: () => d.data })) };
|
||||
return { docs: docs.map(d => ({ id: d.id, data: () => d.data, ref: { path: `${collPath}/${d.id}` } })) };
|
||||
}
|
||||
|
||||
// realtime — emit from mock DB, capture unsub
|
||||
|
||||
Reference in New Issue
Block a user