mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Replace govuk link with usa-link and tested
This commit is contained in:
@@ -29,11 +29,11 @@ from notifications_utils.template import (
|
||||
[
|
||||
(
|
||||
"""https://example.com/"onclick="alert('hi')""",
|
||||
"""<a class="govuk-link govuk-link--no-visited-state" href="https://example.com/%22onclick=%22alert%28%27hi%27%29">https://example.com/"onclick="alert('hi')</a>""", # noqa
|
||||
"""<a class="usa-link usa-link--external" href="https://example.com/%22onclick=%22alert%28%27hi%27%29">https://example.com/"onclick="alert('hi')</a>""", # noqa
|
||||
),
|
||||
(
|
||||
"""https://example.com/"style='text-decoration:blink'""",
|
||||
"""<a class="govuk-link govuk-link--no-visited-state" href="https://example.com/%22style=%27text-decoration:blink%27">https://example.com/"style='text-decoration:blink'</a>""", # noqa
|
||||
"""<a class="usa-link usa-link--external" href="https://example.com/%22style=%27text-decoration:blink%27">https://example.com/"style='text-decoration:blink'</a>""", # noqa
|
||||
),
|
||||
],
|
||||
)
|
||||
@@ -560,9 +560,9 @@ def test_autolink_urls_matches_correctly(content, expected_html):
|
||||
),
|
||||
(
|
||||
{
|
||||
"classes": "govuk-link",
|
||||
"classes": "usa-link",
|
||||
},
|
||||
'<a class="govuk-link" href="http://example.com">http://example.com</a>',
|
||||
'<a class="usa-link" href="http://example.com">http://example.com</a>',
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -480,11 +480,11 @@ def test_markdown_in_templates(
|
||||
# "email",
|
||||
# 'style="word-wrap: break-word; color: #1D70B8;"',
|
||||
# ),
|
||||
(SMSPreviewTemplate, "sms", 'class="govuk-link govuk-link--no-visited-state"'),
|
||||
(SMSPreviewTemplate, "sms", 'class="usa-link usa-link--external"'),
|
||||
(
|
||||
BroadcastPreviewTemplate,
|
||||
"broadcast",
|
||||
'class="govuk-link govuk-link--no-visited-state"',
|
||||
'class="usa-link usa-link--external"',
|
||||
),
|
||||
pytest.param(
|
||||
SMSBodyPreviewTemplate,
|
||||
@@ -558,7 +558,7 @@ def test_makes_links_out_of_URLs_without_protocol_in_sms_and_broadcast(
|
||||
):
|
||||
assert (
|
||||
f"<a "
|
||||
f'class="govuk-link govuk-link--no-visited-state" '
|
||||
f'class="usa-link usa-link--external" '
|
||||
f'href="http://{url_with_entities_replaced}">'
|
||||
f"{url_with_entities_replaced}"
|
||||
f"</a>"
|
||||
|
||||
Reference in New Issue
Block a user