mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Merge branch 'main' into 2589-may-19-zap-scan-fixes
Resolved conflicts by: - Taking all backstop images from main branch - Taking .ds.baseline from main (with updated line numbers) - Keeping template literal security fixes in listEntry.js while incorporating main's styling changes - Taking main's config.py updates (LOGO_CDN_DOMAIN and formatting)
This commit is contained in:
@@ -182,10 +182,14 @@ def test_should_show_create_api_key_page(
|
||||
for index, option in enumerate(expected_options):
|
||||
item = page.select(".usa-radio")[index]
|
||||
if type(option) is tuple:
|
||||
assert normalize_spaces(item.select_one(".usa-label").text) == option[0]
|
||||
assert normalize_spaces(item.select_one(".usa-hint").text) == option[1]
|
||||
label = item.select_one(".usa-radio__label")
|
||||
hint = label.select_one(".usa-hint")
|
||||
# Get the label text without the hint text
|
||||
label_text = label.text.replace(hint.text, "").strip() if hint else label.text
|
||||
assert normalize_spaces(label_text) == option[0]
|
||||
assert normalize_spaces(hint.text) == option[1]
|
||||
else:
|
||||
assert normalize_spaces(item.select_one(".usa-label").text) == option
|
||||
assert normalize_spaces(item.select_one(".usa-radio__label").text) == option
|
||||
|
||||
|
||||
def test_should_create_api_key_with_type_normal(
|
||||
|
||||
@@ -144,11 +144,11 @@ def test_default_email_sender_is_checked_and_has_hint(
|
||||
".set_sender", service_id=SERVICE_ONE_ID, template_id=fake_uuid
|
||||
)
|
||||
|
||||
assert page.select(".usa-radios input")[0].has_attr("checked")
|
||||
assert page.select(".usa-radio input")[0].has_attr("checked")
|
||||
assert (
|
||||
normalize_spaces(page.select_one(".usa-radios .usa-hint").text) == "(Default)"
|
||||
normalize_spaces(page.select_one(".usa-radio .usa-hint").text) == "(Default)"
|
||||
)
|
||||
assert not page.select(".usa-radios input")[1].has_attr("checked")
|
||||
assert not page.select(".usa-radio input")[1].has_attr("checked")
|
||||
|
||||
|
||||
def test_default_sms_sender_is_checked_and_has_hint(
|
||||
@@ -161,11 +161,11 @@ def test_default_sms_sender_is_checked_and_has_hint(
|
||||
".set_sender", service_id=SERVICE_ONE_ID, template_id=fake_uuid
|
||||
)
|
||||
|
||||
assert page.select(".usa-radios input")[0].has_attr("checked")
|
||||
assert page.select(".usa-radio input")[0].has_attr("checked")
|
||||
assert (
|
||||
normalize_spaces(page.select_one(".usa-radios .usa-hint").text) == "(Default)"
|
||||
normalize_spaces(page.select_one(".usa-radio .usa-hint").text) == "(Default)"
|
||||
)
|
||||
assert not page.select(".usa-radios input")[1].has_attr("checked")
|
||||
assert not page.select(".usa-radio input")[1].has_attr("checked")
|
||||
|
||||
|
||||
def test_default_sms_sender_is_checked_and_has_hint_when_there_are_no_inbound_numbers(
|
||||
@@ -178,11 +178,11 @@ def test_default_sms_sender_is_checked_and_has_hint_when_there_are_no_inbound_nu
|
||||
".set_sender", service_id=SERVICE_ONE_ID, template_id=fake_uuid
|
||||
)
|
||||
|
||||
assert page.select(".usa-radios input")[0].has_attr("checked")
|
||||
assert page.select(".usa-radio input")[0].has_attr("checked")
|
||||
assert (
|
||||
normalize_spaces(page.select_one(".usa-radios .usa-hint").text) == "(Default)"
|
||||
normalize_spaces(page.select_one(".usa-radio .usa-hint").text) == "(Default)"
|
||||
)
|
||||
assert not page.select(".usa-radios input")[1].has_attr("checked")
|
||||
assert not page.select(".usa-radio input")[1].has_attr("checked")
|
||||
|
||||
|
||||
def test_default_inbound_sender_is_checked_and_has_hint_with_default_and_receives_text(
|
||||
@@ -196,13 +196,13 @@ def test_default_inbound_sender_is_checked_and_has_hint_with_default_and_receive
|
||||
".set_sender", service_id=service_one["id"], template_id=fake_uuid
|
||||
)
|
||||
|
||||
assert page.select(".usa-radios input")[0].has_attr("checked")
|
||||
assert page.select(".usa-radio input")[0].has_attr("checked")
|
||||
assert (
|
||||
normalize_spaces(page.select_one(".usa-radios .usa-hint").text)
|
||||
normalize_spaces(page.select_one(".usa-radio .usa-hint").text)
|
||||
== "(Default and receives replies)"
|
||||
)
|
||||
assert not page.select(".usa-radios input")[1].has_attr("checked")
|
||||
assert not page.select(".usa-radios input")[2].has_attr("checked")
|
||||
assert not page.select(".usa-radio input")[1].has_attr("checked")
|
||||
assert not page.select(".usa-radio input")[2].has_attr("checked")
|
||||
|
||||
|
||||
def test_sms_sender_has_receives_replies_hint(
|
||||
@@ -216,13 +216,13 @@ def test_sms_sender_has_receives_replies_hint(
|
||||
".set_sender", service_id=service_one["id"], template_id=fake_uuid
|
||||
)
|
||||
|
||||
assert page.select(".usa-radios input")[0].has_attr("checked")
|
||||
assert page.select(".usa-radio input")[0].has_attr("checked")
|
||||
assert (
|
||||
normalize_spaces(page.select_one(".usa-radios .usa-hint").text)
|
||||
normalize_spaces(page.select_one(".usa-radio .usa-hint").text)
|
||||
== "(Default and receives replies)"
|
||||
)
|
||||
assert not page.select(".usa-radios input")[1].has_attr("checked")
|
||||
assert not page.select(".usa-radios input")[2].has_attr("checked")
|
||||
assert not page.select(".usa-radio input")[1].has_attr("checked")
|
||||
assert not page.select(".usa-radio input")[2].has_attr("checked")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
Reference in New Issue
Block a user