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

test(A02): empty opening input returns actionable blocked report

davoodmehraban89 committed Oct 16, 2026 at 16:59 UTC 8f2ae865a2f8f7471065d329afde36f7be3a5163
1 file changed +9
tests/a02-opening-posting-integration.test.mjs
+9
@@ -181,3 +181,12 @@ test('A02: an unbalanced opening preview displays its discrepancy without ledger
181 }), /UNBALANCED_OPENING_JOURNAL/);
182 assert.equal((await StorageService.getAll('journal_entries')).length, 0);
183 });
184 +
185 +test('A02: empty opening file produces a blocked report instead of a validation exception', async () => {
186 + const { input } = await setup();
187 + input.lines = [];
188 + const review = await OpeningBalanceService.preview(input);
189 + assert.equal(review.readiness, 'blocked');
190 + assert.ok(review.issues.includes('MISSING_OPENING_JOURNAL_LINES'));
191 + assert.equal((await StorageService.getAll('journal_entries')).length, 0);
192 +});