From 2355d1e0e6a4cf8491a8d78fe01dc3cf3490f049 Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Fri, 2 Jul 2021 16:25:45 +0100 Subject: [PATCH 1/2] Explain about text message prefixes when editing Previously this lead to 2 support tickets because the user didn't understand why their messages was being split into 2 fragments. We tried modifying the message about charges, but that made it more complicated. Adding a hint should hopefully be enough. --- app/templates/views/edit-sms-template.html | 5 +++++ tests/app/main/views/test_templates.py | 24 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/app/templates/views/edit-sms-template.html b/app/templates/views/edit-sms-template.html index 8522e4e38..c9970c6cc 100644 --- a/app/templates/views/edit-sms-template.html +++ b/app/templates/views/edit-sms-template.html @@ -15,6 +15,10 @@ back_link=url_for('main.view_template', service_id=current_service.id, template_id=template.id) if template else url_for('main.choose_template', service_id=current_service.id, template_folder_id=template_folder_id) ) }} + {% if current_service.prefix_sms %} + {% set content_hint = 'All messages will start with your service name' %} + {% endif %} + {% call form_wrapper() %}
@@ -26,6 +30,7 @@ form.template_content, highlight_placeholders=True, width='1-1', + hint=content_hint, rows=5, extra_form_group_classes='govuk-!-margin-bottom-2' ) }} diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index 4412c4bb0..ec08d76ae 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -1024,6 +1024,30 @@ def test_should_let_letter_contact_block_be_changed_for_the_template( )['href'] == expected_partial_url(service_id=SERVICE_ONE_ID) +@pytest.mark.parametrize('prefix_sms', [ + True, + pytest.param(False, marks=pytest.mark.xfail()) +]) +def test_should_show_message_with_prefix_hint_if_enabled_for_service( + client_request, + mocker, + mock_get_service_template, + mock_get_users_by_service, + service_one, + fake_uuid, + prefix_sms +): + service_one['prefix_sms'] = prefix_sms + + page = client_request.get( + '.edit_service_template', + service_id=service_one['id'], + template_id=fake_uuid, + ) + + assert 'All messages will start with your service name' in page.text + + def test_should_show_page_template_with_priority_select_if_platform_admin( platform_admin_client, platform_admin_user, From b4bd97828927ba22dccdbe6e5f332d1735a9d9ca Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Tue, 6 Jul 2021 16:30:24 +0100 Subject: [PATCH 2/2] Update content following review with Karl --- app/templates/views/edit-sms-template.html | 2 +- tests/app/main/views/test_templates.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/views/edit-sms-template.html b/app/templates/views/edit-sms-template.html index c9970c6cc..57522c8c3 100644 --- a/app/templates/views/edit-sms-template.html +++ b/app/templates/views/edit-sms-template.html @@ -16,7 +16,7 @@ ) }} {% if current_service.prefix_sms %} - {% set content_hint = 'All messages will start with your service name' %} + {% set content_hint = 'Your message will start with your service name' %} {% endif %} {% call form_wrapper() %} diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index ec08d76ae..dbf980ab5 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -1045,7 +1045,7 @@ def test_should_show_message_with_prefix_hint_if_enabled_for_service( template_id=fake_uuid, ) - assert 'All messages will start with your service name' in page.text + assert 'Your message will start with your service name' in page.text def test_should_show_page_template_with_priority_select_if_platform_admin(