mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Show try again link when email verification fails
This commit is contained in:
@@ -31,5 +31,6 @@
|
|||||||
{{ banner("Yay success! Your new reply-to email has been added ^__^", type='message', with_tick=True) }}
|
{{ banner("Yay success! Your new reply-to email has been added ^__^", type='message', with_tick=True) }}
|
||||||
{% elif verification_status == "failure" %}
|
{% elif verification_status == "failure" %}
|
||||||
{{ banner("Sorry dawg, this email address doesn't seem to be working :d", type='dangerous') }}
|
{{ banner("Sorry dawg, this email address doesn't seem to be working :d", type='dangerous') }}
|
||||||
|
<a href={{ url_for('main.service_add_email_reply_to', service_id=service_id) }}>Try again</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -2003,34 +2003,6 @@ def test_incorrect_sms_sender_input(
|
|||||||
assert count_of_api_calls == 0
|
assert count_of_api_calls == 0
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('fixture, data, api_default_args', [
|
|
||||||
(no_reply_to_email_addresses, {}, True),
|
|
||||||
(multiple_reply_to_email_addresses, {}, False),
|
|
||||||
(multiple_reply_to_email_addresses, {"is_default": "y"}, True)
|
|
||||||
])
|
|
||||||
def test_add_reply_to_email_address(
|
|
||||||
fixture,
|
|
||||||
data,
|
|
||||||
api_default_args,
|
|
||||||
mocker,
|
|
||||||
client_request,
|
|
||||||
mock_add_reply_to_email_address
|
|
||||||
):
|
|
||||||
fixture(mocker)
|
|
||||||
data['email_address'] = "test@example.com"
|
|
||||||
client_request.post(
|
|
||||||
'main.service_add_email_reply_to',
|
|
||||||
service_id=SERVICE_ONE_ID,
|
|
||||||
_data=data
|
|
||||||
)
|
|
||||||
|
|
||||||
mock_add_reply_to_email_address.assert_called_once_with(
|
|
||||||
SERVICE_ONE_ID,
|
|
||||||
email_address="test@example.com",
|
|
||||||
is_default=api_default_args
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('fixture, data, api_default_args', [
|
@pytest.mark.parametrize('fixture, data, api_default_args', [
|
||||||
(no_reply_to_email_addresses, {}, True),
|
(no_reply_to_email_addresses, {}, True),
|
||||||
(multiple_reply_to_email_addresses, {}, False),
|
(multiple_reply_to_email_addresses, {}, False),
|
||||||
@@ -2052,18 +2024,18 @@ def test_add_reply_to_email_address_sends_test_notification(
|
|||||||
service_id=SERVICE_ONE_ID,
|
service_id=SERVICE_ONE_ID,
|
||||||
notification_id="123",
|
notification_id="123",
|
||||||
_external=True,
|
_external=True,
|
||||||
)
|
) + "?is_default={}".format(api_default_args)
|
||||||
)
|
)
|
||||||
mock_verify.assert_called_once_with("test@example.com")
|
mock_verify.assert_called_once_with("test@example.com")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("is_default", ["True", "False"])
|
@pytest.mark.parametrize("is_default", [True, False])
|
||||||
@pytest.mark.parametrize("status,expected_failure,expected_success", [
|
@pytest.mark.parametrize("status,expected_failure,expected_success", [
|
||||||
("delivered", 0, 1),
|
("delivered", 0, 1),
|
||||||
("pending", 0, 0),
|
("pending", 0, 0),
|
||||||
("permanent-failure", 1, 0),
|
("permanent-failure", 1, 0),
|
||||||
])
|
])
|
||||||
def test_add_reply_to_email_address_waiting_page(
|
def test_verify_reply_to_address(
|
||||||
mocker, client_request, fake_uuid, status, expected_failure, expected_success, is_default
|
mocker, client_request, fake_uuid, status, expected_failure, expected_success, is_default
|
||||||
):
|
):
|
||||||
notification = {
|
notification = {
|
||||||
@@ -2092,6 +2064,10 @@ def test_add_reply_to_email_address_waiting_page(
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
mock_add_reply_to_email_address.assert_not_called()
|
mock_add_reply_to_email_address.assert_not_called()
|
||||||
|
if status == "permanent-failure":
|
||||||
|
assert page.find('a', text='Try again').attrs["href"] == url_for(
|
||||||
|
'main.service_add_email_reply_to', service_id=SERVICE_ONE_ID
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_add_reply_to_email_address_success():
|
def test_add_reply_to_email_address_success():
|
||||||
|
|||||||
Reference in New Issue
Block a user