mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 17:38:50 -04:00
Go back to triage page if you’ve come from there
This commit is contained in:
@@ -135,6 +135,11 @@ def feedback(ticket_type):
|
||||
return render_template(
|
||||
'views/support/form.html',
|
||||
form=form,
|
||||
back_link=(
|
||||
url_for('.support')
|
||||
if severe is None else
|
||||
url_for('.triage', ticket_type=ticket_type)
|
||||
),
|
||||
show_status_page_banner=(ticket_type == PROBLEM_TICKET_TYPE),
|
||||
page_title={
|
||||
GENERAL_TICKET_TYPE: 'Contact GOV.UK Notify support',
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
{{ page_header(
|
||||
page_title,
|
||||
back_link=url_for('.support')
|
||||
back_link=back_link
|
||||
) }}
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
|
||||
@@ -462,6 +462,38 @@ def test_triage_redirects_to_correct_url(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('extra_args, expected_back_link', [
|
||||
(
|
||||
{'severe': 'yes'},
|
||||
partial(url_for, 'main.triage', ticket_type=PROBLEM_TICKET_TYPE)
|
||||
),
|
||||
(
|
||||
{'severe': 'no'},
|
||||
partial(url_for, 'main.triage', ticket_type=PROBLEM_TICKET_TYPE)
|
||||
),
|
||||
(
|
||||
{'severe': 'foo'}, # hacking the URL
|
||||
partial(url_for, 'main.support')
|
||||
),
|
||||
(
|
||||
{},
|
||||
partial(url_for, 'main.support')
|
||||
),
|
||||
])
|
||||
def test_back_link_from_form(
|
||||
client_request,
|
||||
extra_args,
|
||||
expected_back_link,
|
||||
):
|
||||
page = client_request.get(
|
||||
'main.feedback',
|
||||
ticket_type=PROBLEM_TICKET_TYPE,
|
||||
**extra_args
|
||||
)
|
||||
assert page.select_one('.govuk-back-link')['href'] == expected_back_link()
|
||||
assert normalize_spaces(page.select_one('h1').text) == 'Report a problem'
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
(
|
||||
'is_in_business_hours, severe,'
|
||||
|
||||
Reference in New Issue
Block a user