@davoodmehraban89 / Aram / commits / f6c271b
Fork 0

test(desktop): reject malformed source exposure values in detail view

davoodmehraban89 committed Oct 31, 2026 at 21:48 UTC f6c271b457a902aee7e4bd3932d108f9e10d9ec6
1 file changed +12
backend/tests/test_desktop_five_statement_details.py
+12
@@ -136,3 +136,15 @@ def test_integrity_gate_rejects_truthy_non_boolean_approval_flag():
136 )
137 with pytest.raises(CoverageError, match="PROVENANCE"):
138 validate_desktop_pipeline_result(forged)
139 +
140 +
141 +def test_invalid_source_exposure_amount_fails_closed():
142 + result = build_pipeline()
143 + line = replace(result.balance_sheet.lines[0], source_closing_exposure="NaN")
144 + changed = replace(
145 + result, balance_sheet=replace(
146 + result.balance_sheet, lines=(line,) + result.balance_sheet.lines[1:],
147 + ),
148 + )
149 + with pytest.raises(CoverageError, match="SOURCE_INVALID"):
150 + build_preview_details(changed)