mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-16 11:20:12 -04:00
notify-536: accurately reflect delivery receipts in UI (#551)
This commit is contained in:
@@ -520,7 +520,7 @@ def test_get_status_filters_calculates_stats(client_request):
|
||||
|
||||
assert {label: count for label, _option, _link, count in ret} == {
|
||||
'total': 6,
|
||||
'sending': 3,
|
||||
'pending': 3,
|
||||
'failed': 2,
|
||||
'delivered': 1
|
||||
}
|
||||
@@ -530,7 +530,7 @@ def test_get_status_filters_in_right_order(client_request):
|
||||
ret = get_status_filters(Service({'id': 'foo'}), 'sms', STATISTICS)
|
||||
|
||||
assert [label for label, _option, _link, _count in ret] == [
|
||||
'total', 'sending', 'delivered', 'failed'
|
||||
'total', 'pending', 'delivered', 'failed'
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ def test_should_show_job_in_progress(
|
||||
normalize_spaces(link.text)
|
||||
for link in page.select('.pill a:not(.pill-item--selected)')
|
||||
] == [
|
||||
'10 sending text messages', '0 delivered text messages', '0 failed text messages'
|
||||
'10 pending text messages', '0 delivered text messages', '0 failed text messages'
|
||||
]
|
||||
assert page.select_one('p.hint').text.strip() == 'Report is 50% complete…'
|
||||
|
||||
@@ -207,7 +207,7 @@ def test_should_show_job_without_notifications(
|
||||
normalize_spaces(link.text)
|
||||
for link in page.select('.pill a:not(.pill-item--selected)')
|
||||
] == [
|
||||
'10 sending text messages', '0 delivered text messages', '0 failed text messages'
|
||||
'10 pending text messages', '0 delivered text messages', '0 failed text messages'
|
||||
]
|
||||
assert page.select_one('p.hint').text.strip() == 'Report is 50% complete…'
|
||||
assert page.select_one('tbody').text.strip() == 'No messages to show yet…'
|
||||
@@ -307,7 +307,7 @@ def test_should_show_old_job(
|
||||
for column in page.select('main .govuk-grid-column-one-quarter')
|
||||
] == [
|
||||
'1 total text messages',
|
||||
'1 sending text message',
|
||||
'1 pending',
|
||||
'0 delivered text messages',
|
||||
'0 failed text messages',
|
||||
]
|
||||
@@ -395,7 +395,7 @@ def test_should_show_updates_for_one_job_as_json(
|
||||
)
|
||||
|
||||
content = json.loads(response.get_data(as_text=True))
|
||||
assert 'sending' in content['counts']
|
||||
assert 'pending' in content['counts']
|
||||
assert 'delivered' in content['counts']
|
||||
assert 'failed' in content['counts']
|
||||
assert 'Recipient' in content['notifications']
|
||||
@@ -432,7 +432,7 @@ def test_should_show_updates_for_scheduled_job_as_json(
|
||||
)
|
||||
|
||||
content = response.json
|
||||
assert 'sending' in content['counts']
|
||||
assert 'pending' in content['counts']
|
||||
assert 'delivered' in content['counts']
|
||||
assert 'failed' in content['counts']
|
||||
assert 'Recipient' in content['notifications']
|
||||
|
||||
@@ -15,7 +15,8 @@ from tests.conftest import (
|
||||
|
||||
@pytest.mark.parametrize('key_type, notification_status, expected_status', [
|
||||
(None, 'created', 'Sending'),
|
||||
(None, 'sending', 'Sending'),
|
||||
(None, 'sending',
|
||||
"Pending. Messages will remain in pending state until carrier status is received, typically 5 minutes."),
|
||||
(None, 'delivered', 'Delivered'),
|
||||
(None, 'failed', 'Failed'),
|
||||
(None, 'temporary-failure', 'Phone not accepting messages right now'),
|
||||
@@ -23,7 +24,8 @@ from tests.conftest import (
|
||||
(None, 'technical-failure', 'Technical failure'),
|
||||
('team', 'delivered', 'Delivered'),
|
||||
('live', 'delivered', 'Delivered'),
|
||||
('test', 'sending', 'Sending (test)'),
|
||||
('test', 'sending',
|
||||
"Pending. Messages will remain in pending state until carrier status is received, typically 5 minutes. (test)"),
|
||||
('test', 'delivered', 'Delivered (test)'),
|
||||
('test', 'permanent-failure', 'Not delivered (test)'),
|
||||
])
|
||||
|
||||
@@ -49,7 +49,7 @@ def test_get_upload_hub_page(
|
||||
assert normalize_spaces(uploads[0].text.strip()) == (
|
||||
'some.csv '
|
||||
'Sent 1 January 2016 at 11:09am '
|
||||
'0 sending 8 delivered 2 failed'
|
||||
'0 pending 8 delivered 2 failed'
|
||||
)
|
||||
assert uploads[0].select_one('a.file-list-filename-large')['href'] == (
|
||||
'/services/{}/jobs/job_id_1'.format(SERVICE_ONE_ID)
|
||||
|
||||
Reference in New Issue
Block a user