mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-20 16:13:24 -04:00
Ensure the tour sidebar gets shown
I accidentally broke it by removing a parameter. This commit reinstates that parameter and adds some tests to make sure it doesn’t happen again.
This commit is contained in:
@@ -302,6 +302,7 @@ def send_test_step(service_id, template_id, step_index):
|
||||
skip_link=skip_link,
|
||||
optional_placeholder=optional_placeholder,
|
||||
back_link=back_link,
|
||||
help=get_help_argument(),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -335,46 +335,54 @@ def test_send_test_step_redirects_if_session_not_setup(
|
||||
assert session['send_test_values'] == expected_session_contents
|
||||
|
||||
|
||||
@pytest.mark.parametrize('template_mock, partial_url, expected_h1', [
|
||||
@pytest.mark.parametrize('template_mock, partial_url, expected_h1, tour_shown', [
|
||||
(
|
||||
mock_get_service_template_with_placeholders,
|
||||
partial(url_for, 'main.send_test'),
|
||||
'Send to one recipient',
|
||||
False,
|
||||
),
|
||||
(
|
||||
mock_get_service_template_with_placeholders,
|
||||
partial(url_for, 'main.send_one_off'),
|
||||
'Send to one recipient',
|
||||
False,
|
||||
),
|
||||
(
|
||||
mock_get_service_template_with_placeholders,
|
||||
partial(url_for, 'main.send_test', help=1),
|
||||
'Example text message',
|
||||
True,
|
||||
),
|
||||
(
|
||||
mock_get_service_email_template,
|
||||
partial(url_for, 'main.send_test', help=1),
|
||||
'Example text message',
|
||||
True,
|
||||
),
|
||||
(
|
||||
mock_get_service_email_template,
|
||||
partial(url_for, 'main.send_test'),
|
||||
'Send to one recipient',
|
||||
False,
|
||||
),
|
||||
(
|
||||
mock_get_service_email_template,
|
||||
partial(url_for, 'main.send_one_off'),
|
||||
'Send to one recipient',
|
||||
False,
|
||||
),
|
||||
(
|
||||
mock_get_service_letter_template,
|
||||
partial(url_for, 'main.send_test'),
|
||||
'Print a test letter',
|
||||
False,
|
||||
),
|
||||
(
|
||||
mock_get_service_letter_template,
|
||||
partial(url_for, 'main.send_one_off'),
|
||||
'Print a test letter',
|
||||
False,
|
||||
),
|
||||
])
|
||||
def test_send_one_off_or_test_has_correct_page_titles(
|
||||
@@ -385,6 +393,7 @@ def test_send_one_off_or_test_has_correct_page_titles(
|
||||
template_mock,
|
||||
partial_url,
|
||||
expected_h1,
|
||||
tour_shown,
|
||||
):
|
||||
|
||||
template_mock(mocker)
|
||||
@@ -399,6 +408,8 @@ def test_send_one_off_or_test_has_correct_page_titles(
|
||||
assert response.status_code == 200
|
||||
assert page.h1.text.strip() == expected_h1
|
||||
|
||||
assert (len(page.select('.banner-tour')) == 1) == tour_shown
|
||||
|
||||
|
||||
@pytest.mark.parametrize('template_mock, expected_link_text, expected_link_url', [
|
||||
(mock_get_service_template, 'Use my phone number', partial(url_for, 'main.send_test')),
|
||||
|
||||
Reference in New Issue
Block a user