فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

test(A01): seed simulated correction key inside an IndexedDB transaction

davoodmehraban89 committed Oct 22, 2026 at 23:19 UTC 929a66c2f9d2d64d29c416624447d6d366d88cd4
1 file changed +5 -3
tests/retail-phase2.test.mjs
+5 -3
@@ -1003,9 +1003,11 @@ test('A01: duplicate endorsement correction key rolls back GL, status and audit
1003 contactId:'contact-1',amount:120,chequeNumber:'E120'
1004 });
1005 const idem=JSON.stringify([company,'cheque_endorsement',id,2]);
1006 - await db.put('document_corrections',{
1007 - id:'collision-endorsement',companyId:company,sourceType:'cheque',sourceId:'fixture',
1008 - correctionType:'endorsement',idempotencyKey:idem
1006 + await db.transaction(['document_corrections'],async tx=>{
1007 + await tx.add('document_corrections',{
1008 + id:'collision-endorsement',companyId:company,sourceType:'cheque',sourceId:'fixture',
1009 + correctionType:'endorsement',idempotencyKey:idem
1010 + });
1011 });
1012 const before={
1013 cheque:await db.get('cheques',id),