mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Add a page to pick a template to reply with
If your service is receiving inbound messages, you might want to reply to them. Without an API integration, the only way to do this is by doing the send one off flow. But currently there is no direct link from the page which shows the inbound messages. So this commit: - adds a link to a new page… - …which shows the available (ie only text message) templates with which you can reply
This commit is contained in:
@@ -214,3 +214,51 @@ def test_view_conversation_with_empty_inbound(
|
||||
|
||||
messages = page.select('.sms-message-wrapper')
|
||||
assert len(messages) == 1
|
||||
|
||||
|
||||
def test_conversation_links_to_reply(
|
||||
client_request,
|
||||
fake_uuid,
|
||||
mock_get_notification,
|
||||
mock_get_notifications,
|
||||
mock_get_inbound_sms,
|
||||
):
|
||||
page = client_request.get(
|
||||
'main.conversation',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
notification_id=fake_uuid,
|
||||
)
|
||||
|
||||
assert page.select('main p')[-1].select_one('a')['href'] == (
|
||||
url_for(
|
||||
'.conversation_reply',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
notification_id=fake_uuid,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def test_conversation_reply_shows_templates(
|
||||
client_request,
|
||||
fake_uuid,
|
||||
mock_get_service_templates,
|
||||
):
|
||||
page = client_request.get(
|
||||
'main.conversation_reply',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
notification_id=fake_uuid,
|
||||
)
|
||||
|
||||
for index, expected in enumerate([
|
||||
'sms_template_one',
|
||||
'sms_template_two',
|
||||
]):
|
||||
link = page.select('.message-name')[index]
|
||||
assert normalize_spaces(link.text) == expected
|
||||
assert link.select_one('a')['href'].startswith(
|
||||
url_for(
|
||||
'main.view_template',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id='',
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user