mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Only show the link to use list if service has lists
Most services won’t be interested in the contact list feature, so we shouldn’t clutter up the interface with the extra link.
This commit is contained in:
@@ -1424,6 +1424,7 @@ def test_platform_admin_has_link_to_use_existing_list(
|
||||
client_request,
|
||||
mock_get_service_template,
|
||||
mock_has_jobs,
|
||||
mock_get_contact_lists,
|
||||
fake_uuid,
|
||||
user,
|
||||
):
|
||||
@@ -1465,6 +1466,32 @@ def test_platform_admin_has_link_to_use_existing_list(
|
||||
]
|
||||
|
||||
|
||||
def test_no_link_to_use_existing_list_for_service_without_lists(
|
||||
mocker,
|
||||
client_request,
|
||||
mock_get_service_template,
|
||||
mock_has_jobs,
|
||||
fake_uuid,
|
||||
):
|
||||
mocker.patch(
|
||||
'app.models.contact_list.ContactLists.client_method',
|
||||
return_value=[],
|
||||
)
|
||||
client_request.login(create_platform_admin_user())
|
||||
page = client_request.get(
|
||||
'main.send_one_off',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id=fake_uuid,
|
||||
_follow_redirects=True,
|
||||
)
|
||||
assert [
|
||||
link.text for link in page.select('form a')
|
||||
] == [
|
||||
'Upload a list of phone numbers',
|
||||
'Use my phone number',
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize('user', (
|
||||
create_active_user_with_permissions(),
|
||||
create_active_caseworking_user(),
|
||||
|
||||
Reference in New Issue
Block a user