From 95078d2d519142bfce2d4ce5eb8a86c9c6745bfa Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 17 Aug 2020 13:01:33 +0100 Subject: [PATCH] Change page title on new broadcast template page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since broadcast services can only have one type of template we probably don’t need to disambiguate what kind of template you’re creating. And you’ve just come from a page where the button says ‘New template’, without the choice of radios after, so it’s nice for the page title to match that. --- .../views/edit-broadcast-template.html | 4 ++-- tests/app/main/views/test_templates.py | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/templates/views/edit-broadcast-template.html b/app/templates/views/edit-broadcast-template.html index 5b97e9a6f..f88bdb44a 100644 --- a/app/templates/views/edit-broadcast-template.html +++ b/app/templates/views/edit-broadcast-template.html @@ -5,13 +5,13 @@ {% from "components/form.html" import form_wrapper %} {% block service_page_title %} - {{ heading_action }} broadcast template + {{ heading_action }} template {% endblock %} {% block maincolumn_content %} {{ page_header( - '{} broadcast template'.format(heading_action), + '{} template'.format(heading_action), 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) ) }} diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index aa2b4ad62..13f859a78 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -2052,6 +2052,26 @@ def test_route_invalid_permissions( service_one) +@pytest.mark.parametrize('template_type, expected', ( + ('email', 'New email template'), + ('sms', 'New text message template'), + ('broadcast', 'New template'), +)) +def test_add_template_page_title( + client_request, + service_one, + template_type, + expected, +): + service_one['permissions'] += [template_type] + page = client_request.get( + '.add_service_template', + service_id=SERVICE_ONE_ID, + template_type=template_type, + ) + assert normalize_spaces(page.select_one('h1').text) == expected + + def test_can_create_email_template_with_emoji( client_request, mock_create_service_template