mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -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(
|
return render_template(
|
||||||
'views/support/form.html',
|
'views/support/form.html',
|
||||||
form=form,
|
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),
|
show_status_page_banner=(ticket_type == PROBLEM_TICKET_TYPE),
|
||||||
page_title={
|
page_title={
|
||||||
GENERAL_TICKET_TYPE: 'Contact GOV.UK Notify support',
|
GENERAL_TICKET_TYPE: 'Contact GOV.UK Notify support',
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
{{ page_header(
|
{{ page_header(
|
||||||
page_title,
|
page_title,
|
||||||
back_link=url_for('.support')
|
back_link=back_link
|
||||||
) }}
|
) }}
|
||||||
<div class="govuk-grid-row">
|
<div class="govuk-grid-row">
|
||||||
<div class="govuk-grid-column-two-thirds">
|
<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(
|
@pytest.mark.parametrize(
|
||||||
(
|
(
|
||||||
'is_in_business_hours, severe,'
|
'is_in_business_hours, severe,'
|
||||||
|
|||||||
Reference in New Issue
Block a user