Always offer option to add new sender

Not sure why we had this logic. We shouldn’t make you jump over to the
settings page if none of the available options are right for this
letter.
This commit is contained in:
Chris Hill-Scott
2019-07-08 09:54:01 +01:00
parent fe7c3259c2
commit 90f56353ab
2 changed files with 9 additions and 8 deletions

View File

@@ -23,9 +23,7 @@
hide_legend=True
) }}
{{ page_footer('Continue') }}
{% if no_senders %}
<a href="{{ url_for('.service_add_letter_contact', service_id=current_service.id, from_template=template_id) }}">Add new sender</a>
{% endif %}
<a href="{{ url_for('.service_add_letter_contact', service_id=current_service.id, from_template=template_id) }}">Add new sender</a>
{% endcall %}
</div>
</div>

View File

@@ -2161,16 +2161,15 @@ def test_set_template_sender(
)
@pytest.mark.parametrize('fixture, add_button_is_on_page', [
(no_letter_contact_blocks, True),
(single_letter_contact_block, False),
@pytest.mark.parametrize('fixture', [
no_letter_contact_blocks,
single_letter_contact_block,
])
def test_add_sender_link_only_appears_on_services_with_no_senders(
client_request,
fake_uuid,
mocker,
fixture,
add_button_is_on_page,
mock_get_service_letter_template,
no_letter_contact_blocks
):
@@ -2181,4 +2180,8 @@ def test_add_sender_link_only_appears_on_services_with_no_senders(
template_id=fake_uuid,
)
assert (page.select_one('.column-three-quarters form > a') is not None) == add_button_is_on_page
assert page.select_one('.column-three-quarters form > a')['href'] == url_for(
'main.service_add_letter_contact',
service_id=SERVICE_ONE_ID,
from_template=fake_uuid,
)