From f12e0fde394b3d67b5617bea681d13311cc878b6 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 1 Jun 2017 13:29:30 +0100 Subject: [PATCH] Ensure the tour sidebar gets shown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- app/main/views/send.py | 1 + tests/app/main/views/test_send.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/main/views/send.py b/app/main/views/send.py index bfa47c33a..de6be4ff1 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -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(), ) diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index f5559bba8..69ebddf74 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -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')),