Only show template navigation when it’s useful

There are lots of services that only send emails, or only send text
messages. For these services, being able to filter the list of templates
but type is pointless – it won’t cut the list down at all.

This commit adds some logic to only show the navigation if the service
has some variety of template types.
This commit is contained in:
Chris Hill-Scott
2017-06-13 15:27:29 +01:00
parent 358edf7f20
commit f386b991cb
4 changed files with 38 additions and 3 deletions

View File

@@ -64,6 +64,19 @@ def test_should_show_page_for_choosing_a_template(
mock_get_service_templates.assert_called_with(SERVICE_ONE_ID)
def test_should_not_show_template_nav_if_only_one_type_of_template(
client_request,
mock_get_service_templates_with_only_one_template,
):
page = client_request.get(
'main.choose_template',
service_id=SERVICE_ONE_ID,
)
assert not page.select('.pill')
def test_should_show_page_for_one_template(
logged_in_client,
mock_get_service_template,