mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Merge pull request #1614 from alphagov/fix-escaped-characters-inbound
Stop escaping special characters in inbound messages
This commit is contained in:
@@ -161,6 +161,29 @@ def test_view_conversation(
|
||||
) == expected
|
||||
|
||||
|
||||
def test_escaped_characters_in_inbound_messages(
|
||||
client_request,
|
||||
mock_get_notification,
|
||||
mock_get_notifications,
|
||||
mock_get_inbound_sms_with_special_characters,
|
||||
fake_uuid,
|
||||
):
|
||||
|
||||
page = client_request.get(
|
||||
'main.conversation',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
notification_id=fake_uuid,
|
||||
)
|
||||
|
||||
assert normalize_spaces(
|
||||
str(page.select_one('.sms-message-inbound .sms-message-wrapper'))
|
||||
) == (
|
||||
"<div class=\"sms-message-wrapper\"> "
|
||||
"the first line's content<br/>the second line's content "
|
||||
"</div>"
|
||||
)
|
||||
|
||||
|
||||
def test_view_conversation_updates(
|
||||
logged_in_client,
|
||||
mocker,
|
||||
|
||||
@@ -172,6 +172,25 @@ def test_inbox_showing_inbound_messages(
|
||||
)
|
||||
|
||||
|
||||
def test_inbox_handles_escaped_characters(
|
||||
client_request,
|
||||
service_one,
|
||||
mock_get_inbound_sms_with_special_characters,
|
||||
):
|
||||
|
||||
service_one['permissions'] = ['inbound_sms']
|
||||
|
||||
page = client_request.get('main.inbox', service_id=SERVICE_ONE_ID)
|
||||
|
||||
assert normalize_spaces(
|
||||
str(page.select_one('tbody tr .file-list-hint'))
|
||||
) == (
|
||||
"<span class=\"file-list-hint\">"
|
||||
"the first line's content the second line's content"
|
||||
"</span>"
|
||||
)
|
||||
|
||||
|
||||
def test_empty_inbox(
|
||||
logged_in_client,
|
||||
service_one,
|
||||
|
||||
Reference in New Issue
Block a user