From 90a959463ffcb10a57a073553a87dbc588c3508f Mon Sep 17 00:00:00 2001 From: karlchillmaid Date: Wed, 24 Nov 2021 15:10:21 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Update=20=E2=80=98Send=E2=80=99=20button=20?= =?UTF-8?q?content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/views/templates/_template.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/views/templates/_template.html b/app/templates/views/templates/_template.html index 5e7997221..a741d6506 100644 --- a/app/templates/views/templates/_template.html +++ b/app/templates/views/templates/_template.html @@ -23,7 +23,7 @@ {% if current_user.has_permissions('send_messages', restrict_admin_usage=True) and not letter_too_long %}
- Send a message using this template + Get ready to send a message using this template
{% endif %} @@ -46,7 +46,7 @@ {% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %}
- Send a message using this template + Get ready to send a message using this template
{% endif %} From 3df49acb731824eb1d27fa6739a73661f3964c5e Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 24 Nov 2021 16:35:34 +0000 Subject: [PATCH 2/2] Add test coverage for link button on template page --- tests/app/main/views/test_templates.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index a686b1997..00703116b 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -867,12 +867,17 @@ def test_edit_letter_templates_postage_updates_postage( ), ( ['manage_templates'], - ['.edit_service_template'], + [ + ('.edit_service_template', 'Edit'), + ], None, ), ( ['send_messages', 'manage_templates'], - ['.set_sender', '.edit_service_template'], + [ + ('.set_sender', 'Get ready to send a message using this template'), + ('.edit_service_template', 'Edit'), + ], None, ), ]) @@ -904,16 +909,17 @@ def test_should_be_able_to_view_a_template_with_links( 'Two week reminder – Templates – service one – GOV.UK Notify' ) - links_in_page = page.select('.pill-separate-item') - - assert len(links_in_page) == len(links_to_be_shown) - - for index, link_to_be_shown in enumerate(links_to_be_shown): - assert links_in_page[index]['href'] == url_for( - link_to_be_shown, + assert [ + (link['href'], normalize_spaces(link.text)) + for link in page.select('.pill-separate-item') + ] == [ + (url_for( + endpoint, service_id=SERVICE_ONE_ID, template_id=fake_uuid, - ) + ), text) + for endpoint, text in links_to_be_shown + ] assert normalize_spaces(page.select_one('main p').text) == ( permissions_warning_to_be_shown or 'To: phone number'