Link to notification from API integration

It’s useful to be able to see what the email or text message looks like,
especially if you’ve sent it with a test API key (so it isn’t in your
inbox or on your phone). We already have the page for this, so we just
need to link to it.
This commit is contained in:
Chris Hill-Scott
2018-09-06 10:41:36 +01:00
parent 29f5a86ff6
commit 2ddf3d5cfe
4 changed files with 12 additions and 12 deletions

View File

@@ -70,27 +70,26 @@ def test_should_show_api_page_with_no_notifications(
assert 'When you send messages via the API theyll appear here.' in rows[len(rows) - 1].text.strip()
@pytest.mark.parametrize('template_type, has_links', [
('sms', False),
('letter', True),
@pytest.mark.parametrize('template_type, link_text', [
('sms', 'View text message'),
('letter', 'View letter'),
('email', 'View email'),
])
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
link_text,
):
mock_get_notifications(mocker, api_user_active, diff_template_type=template_type)
page = client_request.get(
'main.api_integration',
service_id=fake_uuid,
service_id=SERVICE_ONE_ID,
)
assert (page.select_one('details a') is not None) == has_links
assert page.select_one('details a').text.strip() == link_text
@pytest.mark.parametrize('status', [