@davoodmehraban89 / Factor-easy / commits / 02a71d4
Fork 0

سامانه صدور فاکتور و حسابداری

test: assert source reconciliation is centralized in autopost adapter

davoodmehraban89 committed Nov 17, 2026 at 14:05 UTC 02a71d4f3a64625d2455589c6297e05916fc7a25
1 file changed +4 -1
scripts/journal-rpc-adapter.test.mjs
+4 -1
@@ -238,8 +238,11 @@ test('source finalizers no longer create or post journal rows through the legacy
238 assert.match(invoiceFinalizer,/jeRpcPersistSourceRecord\('invoices',invoiceId\)/);
239 assert.doesNotMatch(invoiceFinalizer,/jePostSourceRecord|jeCreateDraft|jePost\(/);
240 assert.match(purchaseFinalizer,/jeRpcAutoPost\('purchase',id\)/);
241 - assert.match(purchaseFinalizer,/jeRpcPersistSourceRecord\('purchases',id\)/);
241 assert.doesNotMatch(purchaseFinalizer,/jePostSourceRecord|jeCreateDraft|jePost\(/);
242 + const adapterSource=await readFile(new URL('../js/journal-rpc.js',import.meta.url),'utf8');
243 + const autoPostStart=adapterSource.indexOf('async function jeRpcAutoPost(');
244 + const autoPostBody=adapterSource.slice(autoPostStart);
245 + assert.match(autoPostBody,/jeRpcPersistSourceRecord\(collection,sourceId\)/);
246 });
247
248 test('sync hydration reads database row version required by journal CAS operations',async()=>{