mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Merge pull request #3911 from alphagov/fix-html-on-old-job-page
Fix HTML showing on old job page
This commit is contained in:
@@ -350,26 +350,34 @@ def _get_job_counts(job):
|
|||||||
count
|
count
|
||||||
) for label, query_param, count in [
|
) for label, query_param, count in [
|
||||||
[
|
[
|
||||||
f'''total<span class="govuk-visually-hidden">
|
Markup(
|
||||||
{"text message" if job_type == "sms" else job_type}s</span>''',
|
f'''total<span class="govuk-visually-hidden">
|
||||||
|
{"text message" if job_type == "sms" else job_type}s</span>'''
|
||||||
|
),
|
||||||
'',
|
'',
|
||||||
job.notification_count
|
job.notification_count
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
f'''sending<span class="govuk-visually-hidden">
|
Markup(
|
||||||
{message_count_noun(job.notifications_sending, job_type)}</span>''',
|
f'''sending<span class="govuk-visually-hidden">
|
||||||
|
{message_count_noun(job.notifications_sending, job_type)}</span>'''
|
||||||
|
),
|
||||||
'sending',
|
'sending',
|
||||||
job.notifications_sending
|
job.notifications_sending
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
f'''delivered<span class="govuk-visually-hidden">
|
Markup(
|
||||||
{message_count_noun(job.notifications_delivered, job_type)}</span>''',
|
f'''delivered<span class="govuk-visually-hidden">
|
||||||
|
{message_count_noun(job.notifications_delivered, job_type)}</span>'''
|
||||||
|
),
|
||||||
'delivered',
|
'delivered',
|
||||||
job.notifications_delivered
|
job.notifications_delivered
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
f'''failed<span class="govuk-visually-hidden">
|
Markup(
|
||||||
{message_count_noun(job.notifications_failed, job_type)}</span>''',
|
f'''failed<span class="govuk-visually-hidden">
|
||||||
|
{message_count_noun(job.notifications_failed, job_type)}</span>'''
|
||||||
|
),
|
||||||
'failed',
|
'failed',
|
||||||
job.notifications_failed
|
job.notifications_failed
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -283,6 +283,15 @@ def test_should_show_old_job(
|
|||||||
assert not page.select('p.hint')
|
assert not page.select('p.hint')
|
||||||
assert not page.select('a[download]')
|
assert not page.select('a[download]')
|
||||||
assert page.select_one('tbody').text.strip() == expected_message
|
assert page.select_one('tbody').text.strip() == expected_message
|
||||||
|
assert [
|
||||||
|
normalize_spaces(column.text)
|
||||||
|
for column in page.select('main .govuk-grid-column-one-quarter')
|
||||||
|
] == [
|
||||||
|
'1 total text messages',
|
||||||
|
'1 sending text message',
|
||||||
|
'0 delivered text messages',
|
||||||
|
'0 failed text messages',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
@freeze_time("2016-01-01 11:09:00.061258")
|
@freeze_time("2016-01-01 11:09:00.061258")
|
||||||
|
|||||||
Reference in New Issue
Block a user