Merge pull request #2731 from alphagov/fix-empty-message

Fix empty folder message
This commit is contained in:
Chris Hill-Scott
2019-02-05 14:55:26 +00:00
committed by GitHub
2 changed files with 21 additions and 3 deletions

View File

@@ -24,10 +24,10 @@ class TemplateList():
yield TemplateListFolder(
item,
folders=self.service.get_template_folders(
self.template_type, item['id']
template_type, item['id']
),
templates=self.service.get_templates(
self.template_type, item['id']
template_type, item['id']
),
ancestors=ancestors,
service_id=self.service.id,
@@ -38,7 +38,7 @@ class TemplateList():
yield sub_item
for item in self.service.get_templates(
self.template_type, template_folder_id
template_type, template_folder_id
):
yield TemplateListTemplate(
item,

View File

@@ -302,6 +302,24 @@ def test_post_add_template_folder_page(client_request, service_one, mocker, pare
],
None,
),
(
'folder_one_one_one folder_one_one folder_one Templates service one GOV.UK Notify',
'Templates / folder_one / folder_one_one / folder_one_one_one',
[
{'template_type': 'email'},
{'template_type': 'email', 'template_folder_id': PARENT_FOLDER_ID},
{'template_type': 'email', 'template_folder_id': CHILD_FOLDER_ID},
],
{
'template_type': 'email',
'template_folder_id': GRANDCHILD_FOLDER_ID,
},
['All', 'Text message', 'Letter'],
[],
[],
[],
'There are no email templates in this folder',
),
(
'folder_two Templates service one GOV.UK Notify',
'Templates / folder_two',