- api.parse_837 / parse_835: pass request.app.state.event_bus into store.add()
- conftest: autouse fixture wires a fresh EventBus onto app.state for every
test, since TestClient does not invoke the FastAPI lifespan handler
unless used as a context manager
- test_pubsub: split get_event_bus coverage into a raises-when-missing test
and a returns-attached-bus test, both save/restore app.state.event_bus
around the assertion so the autouse fixture's bus is preserved
Phase 2 complete: db init moved to lifespan, EventBus is the process-wide
publish point, and the two ingest endpoints publish claim_written /
remittance_written / activity_recorded events on every store.add().
- RawSegmentsPanel: summary now reads 'Show N raw segments' for
non-empty (with singular pluralization). The previous identical
ternary branches read as a bug.
- PartiesGrid: replace the verbose intersection cast on AddressBlock
with a direct ClaimDetailAddress cast (the union's other arm is
Record<string, never>, ruled out by isEmptyAddress above).
ClaimDrawerError.tsx already wraps its error surface with role=alert
(line 36). Apply the same pattern to the ValidationPanel errors
sub-section so assistive tech announces blocking validation failures
when the drawer opens, matching the established sibling pattern.
Warnings stay decorative (no role change) — they're advisories, not
blocks.
The parametrized variant test only exercised 4 of the 6 mapped states
(submitted/denied/paid/pending). Add accepted (-> default) and matched
(-> success) so the entire STATE_VARIANT map is verified, not just the
branches whose tokens happened to be easy to reach.
- npm run typecheck failed on the 0-arg vi.fn<() => void>() because
mock.calls[0] became an empty tuple, so calls[0][2] (the URL arg)
was typed as undefined.
- Constrain the mock to the real (state, unused, url?) signature so
mock.calls[0] is a 3-tuple and [2] is string-or-URL-or-null. Drops
the as-string cast at every callsite.
- readClaimId: URLSearchParams.get returns '' for ?claim=, not null.
Normalize to null so the contract matches the JSDoc and consumers
can treat empty as absent.
- Tests: regression for ?claim= → null; open/close preserves other
query params (?foo=bar survives open/close unchanged).
- Tighten pushStateMock/replaceStateMock typing to vi.fn<() => void>()
per code-review nit (drops the verbose ReturnType<typeof vi.fn>).