Adds more bill status visibility to the dashboard
This commit is contained in:
1 parent
a104685daf
commit
1919d43bf0
6 files changed
+360
-10
No files matched your search
@@ -141,11 +141,29 @@ def test_bills_personal_returns_relevance_and_floats(services):
|
||||
|
||||
def test_bills_personal_requires_auth(services):
|
||||
status, body = api.run(_req("GET", "/api/v1/bills", services,
|
||||
query={"personal": "1"}))
|
||||
query={"personal": "1"}))
|
||||
assert status == 401, body
|
||||
assert body["error"]["code"] == "not_authenticated"
|
||||
|
||||
|
||||
# ---- §5 "upcoming" item 2: each item carries status + reason -------------
|
||||
|
||||
def test_bills_items_carry_status_reason_and_possibly_closed(services):
|
||||
# Every item must expose the "why is this here?" triad so a closed/past
|
||||
# bill doesn't read as a vague "pending" (API_CONTRACT §5 item 2).
|
||||
status, body = api.run(_req("GET", "/api/v1/bills", services,
|
||||
query={"upcoming": "1"}))
|
||||
assert status == 200, body
|
||||
items = body["items"]
|
||||
assert items, "expected at least one item"
|
||||
for it in items:
|
||||
for key in ("status", "reason", "possibly_closed"):
|
||||
assert key in it, key
|
||||
assert it["status"] in ("open", "closed", "unknown")
|
||||
assert isinstance(it["reason"], str) and it["reason"]
|
||||
assert it["possibly_closed"] in (True, False, None)
|
||||
|
||||
|
||||
# ---- six empty states -> 200 items:[] (never 4xx/5xx) ---------------------
|
||||
|
||||
def test_empty_no_next_hearing(services):
|
||||
|
||||
Reference in new issue
Block a user