From f76a9e787a3d074216b5f436d57b1240b19f422f Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Sun, 15 Mar 2020 14:56:52 +0000 Subject: [PATCH] Move skip links underneath the text box If we add another link under it will look weird having two under and one off to the side. It looked sort of balanced when it was just one off to the side and one under. Having all the links under the box makes it less visually noisy. --- app/templates/views/send-test.html | 17 ++++++++++------- tests/app/main/views/test_send.py | 18 +++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/app/templates/views/send-test.html b/app/templates/views/send-test.html index 9f6d1e326..cfde9cb31 100644 --- a/app/templates/views/send-test.html +++ b/app/templates/views/send-test.html @@ -22,24 +22,27 @@ data_kwargs={'force-focus': True} ) %}
-
+
{{ textbox( form.placeholder_value, hint='Optional' if optional_placeholder else None, width='1-1', ) }}
- {% if skip_link %} -
- {{ skip_link[0] }} + {% if skip_link or link_to_upload %} +
+ {% if link_to_upload %} + Upload a list of {{ recipient_count_label(999, template.template_type) }} + {% endif %} + {% if skip_link %} + {{ skip_link[0] }} + {% endif %}
{% endif %}
{% if link_to_upload %}

- - Upload a list of {{ recipient_count_label(999, template.template_type) }} - +

{% endif %} {{ page_footer('Continue') }} diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index 488421cd9..c038c9e43 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -1310,16 +1310,17 @@ def test_send_one_off_has_skip_link( _follow_redirects=True, ) - skip_links = page.select('a.top-gutter-4-3') + skip_links = page.select('form a') if expected_link_text and expected_link_url: - assert skip_links[0].text.strip() == expected_link_text - assert skip_links[0]['href'] == expected_link_url( + assert skip_links[1].text.strip() == expected_link_text + assert skip_links[1]['href'] == expected_link_url( service_id=service_one['id'], template_id=fake_uuid, ) else: - assert not skip_links + with pytest.raises(IndexError): + skip_links[1] @pytest.mark.parametrize('template_type, expected_sticky', [ @@ -1376,9 +1377,9 @@ def test_skip_link_will_not_show_on_sms_one_off_if_service_has_no_mobile_number( assert not skip_links -@pytest.mark.parametrize('user, link_index', ( - (create_active_user_with_permissions(), 2), - (create_active_caseworking_user(), 1), +@pytest.mark.parametrize('user', ( + create_active_user_with_permissions(), + create_active_caseworking_user(), )) def test_send_one_off_offers_link_to_upload( client_request, @@ -1386,7 +1387,6 @@ def test_send_one_off_offers_link_to_upload( mock_get_service_template, mock_has_jobs, user, - link_index, ): client_request.login(user) @@ -1398,7 +1398,7 @@ def test_send_one_off_offers_link_to_upload( ) back_link = page.select('main a')[0] - link = page.select('main a')[link_index] + link = page.select_one('form a') assert back_link.text.strip() == 'Back'