mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Go straight to add if no contact blocks yet
Same as previous commit, but for going forward, not back.
This commit is contained in:
@@ -49,7 +49,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{{ url_for(".edit_template_postage", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-postage">Change</a>
|
<a href="{{ url_for(".edit_template_postage", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-postage">Change</a>
|
||||||
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-body">Edit</a>
|
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-body">Edit</a>
|
||||||
<a href="{{ url_for(".set_template_sender", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-contact">Edit</a>
|
{% if current_service.count_letter_contact_details %}
|
||||||
|
<a href="{{ url_for(".set_template_sender", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-contact">Edit</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{{ url_for(".service_add_letter_contact", service_id=current_service.id, from_template=template.id) }}" class="edit-template-link-letter-contact">Edit</a>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ template|string }}
|
{{ template|string }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ from tests.conftest import (
|
|||||||
ElementNotFound,
|
ElementNotFound,
|
||||||
active_caseworking_user,
|
active_caseworking_user,
|
||||||
active_user_view_permissions,
|
active_user_view_permissions,
|
||||||
|
fake_uuid,
|
||||||
mock_get_service_email_template,
|
mock_get_service_email_template,
|
||||||
mock_get_service_letter_template,
|
mock_get_service_letter_template,
|
||||||
mock_get_service_template,
|
mock_get_service_template,
|
||||||
@@ -687,17 +688,26 @@ def test_should_show_sms_template_with_downgraded_unicode_characters(
|
|||||||
assert rendered_msg in page.text
|
assert rendered_msg in page.text
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('mock_contact_block, expected_partial_url', (
|
||||||
|
(no_letter_contact_blocks, partial(
|
||||||
|
url_for, 'main.service_add_letter_contact', from_template=fake_uuid(),
|
||||||
|
)),
|
||||||
|
(single_letter_contact_block, partial(
|
||||||
|
url_for, 'main.set_template_sender', template_id=fake_uuid(),
|
||||||
|
)),
|
||||||
|
))
|
||||||
def test_should_let_letter_contact_block_be_changed_for_the_template(
|
def test_should_let_letter_contact_block_be_changed_for_the_template(
|
||||||
mocker,
|
mocker,
|
||||||
mock_get_service_letter_template,
|
mock_get_service_letter_template,
|
||||||
mock_get_template_folders,
|
mock_get_template_folders,
|
||||||
no_letter_contact_blocks,
|
|
||||||
client_request,
|
client_request,
|
||||||
service_one,
|
service_one,
|
||||||
fake_uuid,
|
fake_uuid,
|
||||||
|
mock_contact_block,
|
||||||
|
expected_partial_url
|
||||||
):
|
):
|
||||||
service_one['permissions'].append('letter')
|
|
||||||
mocker.patch('app.main.views.templates.get_page_count_for_letter', return_value=1)
|
mocker.patch('app.main.views.templates.get_page_count_for_letter', return_value=1)
|
||||||
|
mock_contact_block(mocker)
|
||||||
|
|
||||||
page = client_request.get(
|
page = client_request.get(
|
||||||
'main.view_template',
|
'main.view_template',
|
||||||
@@ -706,11 +716,9 @@ def test_should_let_letter_contact_block_be_changed_for_the_template(
|
|||||||
_test_page_title=False,
|
_test_page_title=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
assert page.find('a', {'class': 'edit-template-link-letter-contact'})['href'] == url_for(
|
assert page.select_one(
|
||||||
'main.set_template_sender',
|
'a.edit-template-link-letter-contact'
|
||||||
service_id=SERVICE_ONE_ID,
|
)['href'] == expected_partial_url(service_id=SERVICE_ONE_ID)
|
||||||
template_id=fake_uuid,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_should_show_page_template_with_priority_select_if_platform_admin(
|
def test_should_show_page_template_with_priority_select_if_platform_admin(
|
||||||
|
|||||||
Reference in New Issue
Block a user