Auto populate the phone number when replying

Currently the only way of ‘replying’ to an inbound message is by
copy/pasting the phone number from the inbound page into the send one
off page. Rather than making people copy/paste, this commit puts the
phone number in the session, if the user is going through the new reply
flow.
This commit is contained in:
Chris Hill-Scott
2017-10-15 13:40:49 +01:00
parent 88f169d970
commit 91cdc9ffcb
3 changed files with 49 additions and 2 deletions

View File

@@ -257,8 +257,32 @@ def test_conversation_reply_shows_templates(
assert normalize_spaces(link.text) == expected
assert link.select_one('a')['href'].startswith(
url_for(
'main.view_template',
'main.conversation_reply_with_template',
service_id=SERVICE_ONE_ID,
notification_id=fake_uuid,
template_id='',
)
)
def test_conversation_reply_redirects_with_phone_number_from_notification(
client_request,
fake_uuid,
mock_get_notification,
mock_get_service_template,
):
page = client_request.get(
'main.conversation_reply_with_template',
service_id=SERVICE_ONE_ID,
notification_id=fake_uuid,
template_id=fake_uuid,
_follow_redirects=True,
)
for element, expected_text in [
('h1', 'Preview of Two week reminder'),
('.sms-message-recipient', 'To: 07123 456789'),
('.sms-message-wrapper', 'service one: Template <em>content</em> with & entity'),
]:
assert normalize_spaces(page.select_one(element).text) == expected_text