test(api)+docs: assert matchedRemittance=null; fail-loud on fixture drift; tighten docstring

This commit is contained in:
Tyler
2026-06-20 09:56:24 -06:00
parent 129599f0f4
commit 14d61f82b8
2 changed files with 23 additions and 14 deletions
+15 -2
View File
@@ -103,6 +103,11 @@ def test_get_claim_detail_happy_path(seeded_store):
"validation", "rawSegments", "matchedRemittance", "stateHistory",
):
assert k in body, f"missing key {k!r}"
# Spec §3.2: matchedRemittance is `null` for an unpaired claim
# (the dominant UI render path). The matched-populated case is
# covered separately in
# test_get_claim_detail_matched_remit_inlines_summary.
assert body["matchedRemittance"] is None
assert body["id"] == cid
# billedAmount is a number (not a Decimal string).
assert isinstance(body["billedAmount"], (int, float))
@@ -140,7 +145,11 @@ def test_get_claim_detail_state_history_includes_manual_match(seeded_store_with_
"/api/reconciliation/unmatched", headers=JSON,
).json()
if not unmatched["claims"] or not unmatched["remittances"]:
pytest.skip("seeded fixtures don't produce an unmatched pair")
pytest.fail(
"co_medicaid_837p.txt + co_medicaid_835.txt fixtures no longer "
"produce an unmatched pair; matched-remit tests need updating "
"(see seeded_store_with_pair docstring for the expected invariant)"
)
claim_id = unmatched["claims"][0]["id"]
remit_id = unmatched["remittances"][0]["id"]
@@ -180,7 +189,11 @@ def test_get_claim_detail_matched_remit_inlines_summary(seeded_store_with_pair):
"/api/reconciliation/unmatched", headers=JSON,
).json()
if not unmatched["claims"] or not unmatched["remittances"]:
pytest.skip("seeded fixtures don't produce an unmatched pair")
pytest.fail(
"co_medicaid_837p.txt + co_medicaid_835.txt fixtures no longer "
"produce an unmatched pair; matched-remit tests need updating "
"(see seeded_store_with_pair docstring for the expected invariant)"
)
claim_id = unmatched["claims"][0]["id"]
remit_id = unmatched["remittances"][0]["id"]
seeded_store_with_pair.post(