Merge branch 'main' of https://github.com/GSA/notifications-admin into 2133-small-a11y-updates

This commit is contained in:
Jonathan Bobel
2024-12-17 11:34:30 -05:00
23 changed files with 1147 additions and 1014 deletions

View File

@@ -20,21 +20,14 @@ def test_non_logged_in_user_can_see_homepage(
"Reach people where they are with government-powered text messages"
)
assert (
page.select_one(
"a.usa-button.login-button.login-button--primary.margin-right-2"
).text
== "Sign in with \n"
# Assert the entire HTML of the button to include the image
button = page.select_one(
"a.usa-button.login-button.login-button--primary.margin-right-2"
)
assert page.select_one("meta[name=description]") is not None
# This area is hidden for the pilot
# assert normalize_spaces(page.select_one('#whos-using-notify').text) == (
# 'Whos using Notify.gov ' # Hiding this next area for the pilot
# # Hiding this next area for the pilot
# # 'See the list of services and organizations. '
# 'There are 111 Organizations and 9,999 Services using Notify.'
# )
assert "Sign in with" in button.text.strip() # Assert button text
assert button.find("img")["alt"] == "Login.gov logo" # Assert image presence
assert page.select_one("meta[name=description]") is not None
assert page.select_one("#whos-using-notify a") is None
@@ -125,7 +118,7 @@ def test_static_pages(client_request, mock_get_organization_by_domain, view, moc
"write_for_action",
"multiple_languages",
"benchmark_performance",
"guidance_index"
"guidance_index",
]
return (
not current_app.config["FEATURE_BEST_PRACTICES_ENABLED"]

View File

@@ -350,9 +350,13 @@ def test_should_show_templates_folder_page(
assert normalize_spaces(page.select_one("h1").text) == expected_title_tag
# remove this line if you don't want the breadcrumb on the first page
assert len(page.select("nav#breadcrumb-template-folders a")) == len(expected_parent_link_args)
assert len(page.select("nav#breadcrumb-template-folders a")) == len(
expected_parent_link_args
)
for index, parent_link in enumerate(page.select("nav#breadcrumb-template-folders a")):
for index, parent_link in enumerate(
page.select("nav#breadcrumb-template-folders a")
):
assert parent_link["href"] == url_for(
"main.choose_template",
service_id=SERVICE_ONE_ID,

View File

@@ -69,7 +69,9 @@ def test_should_show_empty_page_when_no_templates(
service_id=service_one["id"],
)
assert normalize_spaces(page.select_one("h1").text) == ("Select or create a template")
assert normalize_spaces(page.select_one("h1").text) == (
"Select or create a template"
)
assert normalize_spaces(page.select_one("main p").text) == (expected_message)
assert page.select_one("#add_new_folder_form")
assert page.select_one("#add_new_template_form")
@@ -87,7 +89,9 @@ def test_should_show_add_template_form_if_service_has_folder_permission(
service_id=service_one["id"],
)
assert normalize_spaces(page.select_one("h1").text) == ("Select or create a template")
assert normalize_spaces(page.select_one("h1").text) == (
"Select or create a template"
)
assert normalize_spaces(page.select_one("main p").text) == (
"Every message starts with a template. You can change it later. "
"You need a template before you can send messages."