Removed links to add_template_by_type_endpoint

The endpoint was removed, but was still linked to in a couple of
places. Some old links were no longer needed, so have been removed.

We do still need a link to `add_template_by_type` on the 'Choose reply'
page - this page is used to allow to let someone pick a template to
reply to inbound SMS with. Since the link only appears if they have no
SMS templates, we now link to `.choose_template` with the templates and
folders form already opened at the option to add a template.
This commit is contained in:
Katie Smith
2019-02-14 16:27:13 +00:00
parent 6a66ee0a4f
commit 862d077f66
5 changed files with 45 additions and 15 deletions

View File

@@ -251,6 +251,27 @@ def test_conversation_links_to_reply(
)
def test_conversation_reply_shows_link_to_add_templates_if_service_has_no_templates(
client_request,
fake_uuid,
mock_get_service_templates_when_no_templates_exist,
):
page = client_request.get(
'main.conversation_reply',
service_id=SERVICE_ONE_ID,
notification_id=fake_uuid,
)
page_text = page.find('p', class_='bottom-gutter').text
link = page.find('a', text='Add a new template')['href']
assert normalize_spaces(page_text) == 'You need a template before you can send text messages.'
assert link == url_for(
'main.choose_template',
service_id=SERVICE_ONE_ID,
initial_state='add-new-template'
)
def test_conversation_reply_shows_templates(
client_request,
fake_uuid,

View File

@@ -196,6 +196,21 @@ def test_should_show_page_for_choosing_a_template(
mock_get_template_folders.assert_called_once_with(SERVICE_ONE_ID)
def test_choose_template_can_pass_through_an_initial_state_to_templates_and_folders_selection_form(
client_request,
mock_get_template_folders,
mock_get_service_templates,
):
page = client_request.get(
'main.choose_template',
service_id=SERVICE_ONE_ID,
initial_state='add-new-template'
)
templates_and_folders_form = page.find('form')
assert templates_and_folders_form['data-prev-state'] == 'add-new-template'
def test_should_not_show_template_nav_if_only_one_type_of_template(
client_request,
mock_get_template_folders,