mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-25 10:29:14 -04:00
Fixed test
This commit is contained in:
@@ -269,7 +269,7 @@ def test_invite_goes_in_session(
|
||||
("user", "landing_page_title"),
|
||||
[
|
||||
(create_active_user_with_permissions(), "Dashboard"),
|
||||
(create_active_caseworking_user(), "Templates"),
|
||||
(create_active_caseworking_user(), "Select or create a template"),
|
||||
],
|
||||
)
|
||||
def test_accepting_invite_removes_invite_from_session(
|
||||
|
||||
@@ -1253,7 +1253,7 @@ def test_send_one_off_has_correct_page_title(
|
||||
step_index=0,
|
||||
_follow_redirects=True,
|
||||
)
|
||||
assert page.h1.text.strip() == "Send ‘Two week reminder’"
|
||||
assert page.h1.text.strip() == "Select recipients"
|
||||
|
||||
assert len(page.select(".banner-tour")) == 0
|
||||
|
||||
@@ -2712,7 +2712,7 @@ def test_preview_notification_shows_preview(
|
||||
template_id=fake_uuid,
|
||||
_expected_status=200,
|
||||
)
|
||||
assert page.h1.text.strip() == "Preview"
|
||||
assert page.h1.text.strip() == "Preview for sending"
|
||||
assert (page.find_all("a", {"class": "usa-back-link"})[0]["href"]) == url_for(
|
||||
"main.check_notification",
|
||||
service_id=service_one["id"],
|
||||
|
||||
@@ -41,8 +41,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
(
|
||||
"expected_title_tag",
|
||||
"expected_page_title",
|
||||
"expected_title_tag",
|
||||
"expected_parent_link_args",
|
||||
"extra_args",
|
||||
"expected_nav_links",
|
||||
@@ -53,8 +53,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
),
|
||||
[
|
||||
(
|
||||
"Templates – service one – Notify.gov",
|
||||
"Templates",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[],
|
||||
{},
|
||||
["Email", "Text message"],
|
||||
@@ -92,8 +92,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
None,
|
||||
),
|
||||
(
|
||||
"Templates – service one – Notify.gov",
|
||||
"Templates",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[],
|
||||
{"template_type": "all"},
|
||||
["Email", "Text message"],
|
||||
@@ -131,8 +131,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
None,
|
||||
),
|
||||
(
|
||||
"Templates – service one – Notify.gov",
|
||||
"Templates",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[],
|
||||
{"template_type": "sms"},
|
||||
["All", "Email"],
|
||||
@@ -159,8 +159,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
None,
|
||||
),
|
||||
(
|
||||
"folder_one – Templates – service one – Notify.gov",
|
||||
"Templates folder_one",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[{"template_type": "all"}],
|
||||
{"template_folder_id": PARENT_FOLDER_ID},
|
||||
["Email", "Text message"],
|
||||
@@ -182,8 +182,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
None,
|
||||
),
|
||||
(
|
||||
"folder_one – Templates – service one – Notify.gov",
|
||||
"Templates folder_one",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[{"template_type": "sms"}],
|
||||
{"template_type": "sms", "template_folder_id": PARENT_FOLDER_ID},
|
||||
["All", "Email"],
|
||||
@@ -199,8 +199,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
None,
|
||||
),
|
||||
(
|
||||
"folder_one – Templates – service one – Notify.gov",
|
||||
"Templates folder_one",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[{"template_type": "email"}],
|
||||
{"template_type": "email", "template_folder_id": PARENT_FOLDER_ID},
|
||||
["All", "Text message"],
|
||||
@@ -210,8 +210,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
"There are no email templates in this folder",
|
||||
),
|
||||
(
|
||||
"folder_one_one – folder_one – Templates – service one – Notify.gov",
|
||||
"Templates folder_one folder_one_one",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[
|
||||
{"template_type": "all"},
|
||||
{"template_type": "all", "template_folder_id": PARENT_FOLDER_ID},
|
||||
@@ -229,8 +229,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
None,
|
||||
),
|
||||
(
|
||||
"folder_one_one_one – folder_one_one – folder_one – Templates – service one – Notify.gov",
|
||||
"Templates folder_one folder_one_one folder_one_one_one",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[
|
||||
{"template_type": "all"},
|
||||
{"template_type": "all", "template_folder_id": PARENT_FOLDER_ID},
|
||||
@@ -250,8 +250,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
None,
|
||||
),
|
||||
(
|
||||
"folder_one_one_one – folder_one_one – folder_one – Templates – service one – Notify.gov",
|
||||
"Templates folder_one folder_one_one folder_one_one_one",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[
|
||||
{"template_type": "email"},
|
||||
{"template_type": "email", "template_folder_id": PARENT_FOLDER_ID},
|
||||
@@ -268,8 +268,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
"There are no email templates in this folder",
|
||||
),
|
||||
(
|
||||
"folder_two – Templates – service one – Notify.gov",
|
||||
"Templates folder_two",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[{"template_type": "all"}],
|
||||
{"template_folder_id": FOLDER_TWO_ID},
|
||||
["Email", "Text message"],
|
||||
@@ -279,8 +279,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
"This folder is empty",
|
||||
),
|
||||
(
|
||||
"folder_two – Templates – service one – Notify.gov",
|
||||
"Templates folder_two",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[{"template_type": "sms"}],
|
||||
{"template_folder_id": FOLDER_TWO_ID, "template_type": "sms"},
|
||||
["All", "Email"],
|
||||
@@ -290,8 +290,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
"This folder is empty",
|
||||
),
|
||||
(
|
||||
"folder_two – Templates – service one – Notify.gov",
|
||||
"Templates folder_two",
|
||||
"Select or create a template – service one – Notify.gov",
|
||||
"Select or create a template",
|
||||
[{"template_type": "all"}],
|
||||
{"template_folder_id": FOLDER_TWO_ID, "template_type": "all"},
|
||||
["Email", "Text message"],
|
||||
@@ -346,12 +346,13 @@ def test_should_show_templates_folder_page(
|
||||
**extra_args,
|
||||
)
|
||||
|
||||
assert normalize_spaces(page.select_one("title").text) == expected_title_tag
|
||||
assert normalize_spaces(page.select_one("h1").text) == expected_page_title
|
||||
assert normalize_spaces(page.select_one("title").text) == expected_page_title
|
||||
assert normalize_spaces(page.select_one("h1").text) == expected_title_tag
|
||||
|
||||
assert len(page.select("h1 a")) == len(expected_parent_link_args)
|
||||
# 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)
|
||||
|
||||
for index, parent_link in enumerate(page.select("h1 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,
|
||||
@@ -529,7 +530,7 @@ def test_get_manage_folder_page(
|
||||
_test_page_title=False,
|
||||
)
|
||||
assert normalize_spaces(page.select_one("title").text) == (
|
||||
"folder_two – Templates – service one – Notify.gov"
|
||||
"Select or create a template – service one – Notify.gov"
|
||||
)
|
||||
assert page.select_one("input[name=name]")["value"] == "folder_two"
|
||||
delete_link = page.find("a", string="Delete this folder")
|
||||
@@ -571,7 +572,7 @@ def test_get_manage_folder_viewing_permissions_for_users(
|
||||
_test_page_title=False,
|
||||
)
|
||||
assert normalize_spaces(page.select_one("title").text) == (
|
||||
"folder_two – Templates – service one – Notify.gov"
|
||||
"Select or create a template – service one – Notify.gov"
|
||||
)
|
||||
form_labels = page.select("legend.usa-legend")
|
||||
assert (
|
||||
@@ -634,7 +635,7 @@ def test_get_manage_folder_viewing_permissions_for_users_not_visible_when_no_man
|
||||
_test_page_title=False,
|
||||
)
|
||||
assert normalize_spaces(page.select_one("title").text) == (
|
||||
"folder_two – Templates – service one – Notify.gov"
|
||||
"Select or create a template – service one – Notify.gov"
|
||||
)
|
||||
form_labels = page.select("legend[class=form-label]")
|
||||
assert len(form_labels) == 0
|
||||
@@ -671,7 +672,7 @@ def test_get_manage_folder_viewing_permissions_for_users_not_visible_for_service
|
||||
_test_page_title=False,
|
||||
)
|
||||
assert normalize_spaces(page.select_one("title").text) == (
|
||||
"folder_two – Templates – service one – Notify.gov"
|
||||
"Select or create a template – service one – Notify.gov"
|
||||
)
|
||||
form_labels = page.select("legend[class=form-label]")
|
||||
assert len(form_labels) == 0
|
||||
|
||||
@@ -69,7 +69,7 @@ def test_should_show_empty_page_when_no_templates(
|
||||
service_id=service_one["id"],
|
||||
)
|
||||
|
||||
assert normalize_spaces(page.select_one("h1").text) == ("Templates")
|
||||
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 +87,7 @@ 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) == ("Templates")
|
||||
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."
|
||||
@@ -110,7 +110,7 @@ def test_should_show_add_template_form_if_service_has_folder_permission(
|
||||
[
|
||||
(
|
||||
create_active_user_view_permissions(),
|
||||
"Templates",
|
||||
"Select or create a template",
|
||||
{},
|
||||
["Email", "Text message"],
|
||||
[
|
||||
@@ -122,21 +122,21 @@ def test_should_show_add_template_form_if_service_has_folder_permission(
|
||||
),
|
||||
(
|
||||
create_active_user_view_permissions(),
|
||||
"Templates",
|
||||
"Select or create a template",
|
||||
{"template_type": "sms"},
|
||||
["All", "Email"],
|
||||
["sms_template_one", "sms_template_two"],
|
||||
),
|
||||
(
|
||||
create_active_user_view_permissions(),
|
||||
"Templates",
|
||||
"Select or create a template",
|
||||
{"template_type": "email"},
|
||||
["All", "Text message"],
|
||||
["email_template_one", "email_template_two"],
|
||||
),
|
||||
(
|
||||
create_active_caseworking_user(),
|
||||
"Templates",
|
||||
"Select or create a template",
|
||||
{},
|
||||
["Email", "Text message"],
|
||||
[
|
||||
@@ -148,7 +148,7 @@ def test_should_show_add_template_form_if_service_has_folder_permission(
|
||||
),
|
||||
(
|
||||
create_active_caseworking_user(),
|
||||
"Templates",
|
||||
"Select or create a template",
|
||||
{"template_type": "email"},
|
||||
["All", "Text message"],
|
||||
["email_template_one", "email_template_two"],
|
||||
@@ -581,9 +581,9 @@ def test_should_be_able_to_view_a_template_with_links(
|
||||
_test_page_title=False,
|
||||
)
|
||||
|
||||
assert normalize_spaces(page.select_one("h1").text) == ("Review your message")
|
||||
assert normalize_spaces(page.select_one("h1").text) == ("Confirm your template")
|
||||
assert normalize_spaces(page.select_one("title").text) == (
|
||||
"Two week reminder – Templates – service one – Notify.gov"
|
||||
"Confirm your template – service one – Notify.gov"
|
||||
)
|
||||
|
||||
assert [
|
||||
|
||||
@@ -62,6 +62,7 @@ EXCLUDED_ENDPOINTS = tuple(
|
||||
"conversation_reply",
|
||||
"conversation_reply_with_template",
|
||||
"conversation_updates",
|
||||
"contact",
|
||||
"copy_template",
|
||||
"count_content_length",
|
||||
"create_and_send_messages",
|
||||
|
||||
Reference in New Issue
Block a user