mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 15:58:25 -04:00
Merge pull request #1789 from gov-cjwaszczuk/add-preview-link-in-message-log-for-letters
Add view link in message log for letter notifications
This commit is contained in:
@@ -71,6 +71,9 @@
|
|||||||
<dt>{{ key }}:</dt>
|
<dt>{{ key }}:</dt>
|
||||||
<dd class="api-notifications-item-data-item">{{ notification[key] }}</dd>
|
<dd class="api-notifications-item-data-item">{{ notification[key] }}</dd>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if notification['notification_type'] == 'letter' %}
|
||||||
|
<a href="{{ url_for('.view_notification', service_id=current_service.id, notification_id=notification.id) }}">View letter</a>
|
||||||
|
{% endif %}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from tests.conftest import (
|
|||||||
mock_get_service,
|
mock_get_service,
|
||||||
mock_get_live_service,
|
mock_get_live_service,
|
||||||
mock_get_service_with_letters,
|
mock_get_service_with_letters,
|
||||||
|
mock_get_notifications,
|
||||||
normalize_spaces,
|
normalize_spaces,
|
||||||
SERVICE_ONE_ID,
|
SERVICE_ONE_ID,
|
||||||
mock_get_valid_service_callback_api,
|
mock_get_valid_service_callback_api,
|
||||||
@@ -66,6 +67,29 @@ def test_should_show_api_page_with_no_notifications(
|
|||||||
assert 'When you send messages via the API they’ll appear here.' in rows[len(rows) - 1].text.strip()
|
assert 'When you send messages via the API they’ll appear here.' in rows[len(rows) - 1].text.strip()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('template_type, has_links', [
|
||||||
|
('sms', False),
|
||||||
|
('letter', True),
|
||||||
|
])
|
||||||
|
def test_letter_notifications_should_have_link_to_view_letter(
|
||||||
|
client_request,
|
||||||
|
api_user_active,
|
||||||
|
fake_uuid,
|
||||||
|
mock_has_permissions,
|
||||||
|
mocker,
|
||||||
|
template_type,
|
||||||
|
has_links
|
||||||
|
):
|
||||||
|
mock_get_notifications(mocker, api_user_active, diff_template_type=template_type)
|
||||||
|
|
||||||
|
page = client_request.get(
|
||||||
|
'main.api_integration',
|
||||||
|
service_id=fake_uuid,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert (page.select_one('details a') is not None) == has_links
|
||||||
|
|
||||||
|
|
||||||
def test_should_show_api_page_for_live_service(
|
def test_should_show_api_page_for_live_service(
|
||||||
logged_in_client,
|
logged_in_client,
|
||||||
mock_login,
|
mock_login,
|
||||||
|
|||||||
Reference in New Issue
Block a user