diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index 99506fa51..3f48cb9ec 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -272,7 +272,7 @@ def get_status_filters(service, message_type, statistics): if message_type is None: stats = { key: sum(statistics[message_type][key] for message_type in {"email", "sms"}) - for key in {"requested", "delivered", "failure"} + for key in {"requested", "delivered", "failed"} } else: stats = statistics[message_type] diff --git a/tests/app/main/views/test_activity.py b/tests/app/main/views/test_activity.py index 29a0341de..936bfac80 100644 --- a/tests/app/main/views/test_activity.py +++ b/tests/app/main/views/test_activity.py @@ -531,13 +531,12 @@ def test_time_left(job_created_at, expected_message): assert get_time_left(job_created_at) == expected_message -STATISTICS = {"sms": {"requested": 6, "failed": 2, "delivered": 1}} +STATISTICS = {"sms": {"requested": 6, "failed": 2, "delivered": 1, "pending": 3}} def test_get_status_filters_calculates_stats(client_request): ret = get_status_filters(Service({"id": "foo"}), "sms", STATISTICS) - # TODO WHY DO WE THINK THE PENDING COUNT SHOULD BE 3? HOW DID THIS WORK BEFORE? assert {label: count for label, _option, _link, count in ret} == { "total": 6, "pending": 3,