سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 23:15 UTC
test: await asynchronous posting failure before asserting draft persistence
davoodmehraban89 committed
Oct 11, 2026 at 21:12 UTC
9b4272192468a147bce480532785f53030232f43
1 file changed
+1
-1
scripts/accounting-document-workflow.spec.js
+1
-1
@@ -126,7 +126,7 @@ test('cannot finalize draft if fiscal posting chart has no required account; dra
126
await fillInvoice(page,'FIN-NO-REVENUE-ACCOUNT',2);await page.evaluate(()=>commitSaveInvoice());
127
await expect.poll(()=>remoteInvoices(server).length,{timeout:13000}).toBe(1);
128
const id=remoteInvoices(server)[0].id;
129
- const result=await page.evaluate(x=>{try{finalizeInvoiceDocument(x);return 'unexpected success'}catch(e){return String(e.message)}},id);
129
+ const result=await page.evaluate(async x=>{try{await finalizeInvoiceDocument(x);return 'unexpected success'}catch(e){return String(e.message)}},id);
130
expect(result).toMatch(/حساب|کدینگ/);
131
expect(remoteInvoices(server)[0].accountingStatus).toBe('draft');
132
expect([...server.records.values()].filter(x=>x.collection==='journalVouchers')).toHaveLength(0);