@davoodmehraban89 / Factor-easy / commits / 38bdbab
Fork 0

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

test: assert source autopost retry is server-idempotent

davoodmehraban89 committed Nov 17, 2026 at 21:36 UTC 38bdbabb8ce328896f4b6b225703924df4bec30b
1 file changed +2
scripts/accounting-document-workflow.spec.js
+2
@@ -243,8 +243,10 @@ test('formal invoice remains editable draft across server reload; explicit posti
243 expect(lines.reduce((t,x)=>t+Number(x.data.debit||0),0)).toBe(4500);
244 expect(lines.reduce((t,x)=>t+Number(x.data.credit||0),0)).toBe(4500);
245 expect(posted.journalVoucherId).toBe(vouchers[0].id);
246 + expect(server.autoPostCount).toBe(1);
247 // Repeat post must be idempotent, and posted source cannot be edited or overwritten.
248 await page.evaluate(x=>finalizeInvoiceDocument(x),id);
249 + expect(server.autoPostCount).toBe(1);
250 expect([...server.records.values()].filter(x=>x.collection==='journalVouchers')).toHaveLength(1);
251 await page.evaluate(x=>editInvoice(x),id);
252 await expect(page.locator('#edit-invoice-id')).toHaveValue('');