From e4a9fdb4a60db291b2e0391000ac0c1fce55e9fe Mon Sep 17 00:00:00 2001 From: Jakob Wennberg <149234542+jakobwennberg@users.noreply.github.com> Date: Mon, 29 Jun 2026 22:36:24 +0200 Subject: [PATCH] fix(reports): add missing allLines mock to SIE OB-exclusion test (#828) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #824 moved per-entry line fetching into a single paged journal_entry_lines join query. #809's OB-exclusion test was branched before #824, so its mock queue lacked that response — every later mock shifted by one and the #OBJEKT projects loop read journal-line objects (no .code), throwing TypeError on main. Adds the journal_entry_lines (allLines) mock with lines keyed by journal_entry_id. Test-only; no production code change. Restores green main. Co-authored-by: Claude Opus 4.8 (1M context) --- lib/reports/__tests__/sie-export.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/reports/__tests__/sie-export.test.ts b/lib/reports/__tests__/sie-export.test.ts index ce6a498c..04f5f25e 100644 --- a/lib/reports/__tests__/sie-export.test.ts +++ b/lib/reports/__tests__/sie-export.test.ts @@ -527,6 +527,19 @@ describe('generateSIEExport', () => { ], error: null, }, + // journal_entry_lines (allLines) — #824 moved per-entry lines into a single + // paged join query; lines map back to entries by journal_entry_id (the inline + // entry.lines above are overwritten). The OB entry's lines (excluded from + // movement via obEntryId) and the real transfer's lines both flow through here. + { + data: [ + { id: 'l1', journal_entry_id: 'ob-entry-1', account_number: '1933', debit_amount: 96466.59, credit_amount: 0, line_description: 'IB 1933', cost_center: null, project: null }, + { id: 'l2', journal_entry_id: 'ob-entry-1', account_number: '2019', debit_amount: 0, credit_amount: 96466.59, line_description: null, cost_center: null, project: null }, + { id: 'l3', journal_entry_id: 'e2', account_number: '1930', debit_amount: 96466.59, credit_amount: 0, line_description: null, cost_center: null, project: null }, + { id: 'l4', journal_entry_id: 'e2', account_number: '1933', debit_amount: 0, credit_amount: 96466.59, line_description: null, cost_center: null, project: null }, + ], + error: null, + }, { data: [], error: null }, // cost_centers { data: [], error: null }, // projects // fetchAllRows for OB entry lines (opening_balance_entry_id is set)