Link back to uploaded letters page

If you’ve come to look at a notification via the uploaded letters page
then the ‘< back’ link should take you back there, not to the usual
activity page.
This commit is contained in:
Chris Hill-Scott
2020-05-11 14:20:53 +01:00
parent 34f5417844
commit a9998958b7
7 changed files with 47 additions and 2 deletions

View File

@@ -117,6 +117,10 @@ def test_notification_status_page_respects_redaction(
{'from_job': 'job_id'},
partial(url_for, 'main.view_job', job_id='job_id'),
),
(
{'from_uploaded_letters': '2020-02-02'},
partial(url_for, 'main.uploaded_letters', letter_print_day='2020-02-02'),
),
(
{'help': '0'},
None,

View File

@@ -160,6 +160,10 @@ def test_get_uploaded_letters(
service_id=SERVICE_ONE_ID,
letter_print_day='2020-02-02'
)
assert page.select_one('.govuk-back-link')['href'] == url_for(
'main.uploads',
service_id=SERVICE_ONE_ID,
)
assert normalize_spaces(
page.select_one('h1').text
) == (
@@ -192,6 +196,23 @@ def test_get_uploaded_letters(
),
]
assert [
link['href'] for link in page.select('tbody tr a')
] == [
url_for(
'main.view_notification',
service_id=SERVICE_ONE_ID,
notification_id='03e34025-be54-4d43-8e6a-fb1ea0fd1f29',
from_uploaded_letters='2020-02-02',
),
url_for(
'main.view_notification',
service_id=SERVICE_ONE_ID,
notification_id='fc090d91-e761-4464-9041-9c4594c96a35',
from_uploaded_letters='2020-02-02',
),
]
next_page_link = page.select_one('a[rel=next]')
prev_page_link = page.select_one('a[rel=previous]')
assert next_page_link['href'] == url_for(