mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 03:28:24 -04:00
Merge branch 'main' into 1169-display-confirmation-summary-on-the-preview-page
This commit is contained in:
@@ -160,8 +160,8 @@ def test_can_show_notifications(
|
||||
assert normalize_spaces(
|
||||
first_row.select_one(".table-field-right-aligned .align-with-message-body").text
|
||||
) in [
|
||||
"Delivered 1 January at 02:00 US/Eastern",
|
||||
"Delivered 1 January at 01:00 US/Eastern",
|
||||
"Delivered 01-01-2020 at 01:00 AM",
|
||||
"Delivered 01-01-2020 at 01:00 AM",
|
||||
]
|
||||
|
||||
assert page_title in page.h1.text.strip()
|
||||
@@ -656,36 +656,36 @@ def test_redacts_templates_that_should_be_redacted(
|
||||
@pytest.mark.parametrize(
|
||||
("message_type", "status", "expected_hint_status", "single_line"),
|
||||
[
|
||||
("email", "created", "Sending since 27 September at 08:30 US/Eastern", True),
|
||||
("email", "sending", "Sending since 27 September at 08:30 US/Eastern", True),
|
||||
("email", "created", "Sending since 09-27-2017 at 08:30 AM", True),
|
||||
("email", "sending", "Sending since 09-27-2017 at 08:30 AM", True),
|
||||
(
|
||||
"email",
|
||||
"temporary-failure",
|
||||
"Inbox not accepting messages right now 27 September at 08:30 US/Eastern",
|
||||
"Inbox not accepting messages right now 09-27-2017 at 08:30 AM",
|
||||
False,
|
||||
),
|
||||
(
|
||||
"email",
|
||||
"permanent-failure",
|
||||
"Email address does not exist 27 September at 08:30 US/Eastern",
|
||||
"Email address does not exist 09-27-2017 at 08:30 AM",
|
||||
False,
|
||||
),
|
||||
("email", "delivered", "Delivered 27 September at 08:30 US/Eastern", True),
|
||||
("sms", "created", "Sending since 27 September at 08:30 US/Eastern", True),
|
||||
("sms", "sending", "Sending since 27 September at 08:30 US/Eastern", True),
|
||||
("email", "delivered", "Delivered 09-27-2017 at 08:30 AM", True),
|
||||
("sms", "created", "Sending since 09-27-2017 at 08:30 AM", True),
|
||||
("sms", "sending", "Sending since 09-27-2017 at 08:30 AM", True),
|
||||
(
|
||||
"sms",
|
||||
"temporary-failure",
|
||||
"Phone not accepting messages right now 27 September at 08:30 US/Eastern",
|
||||
"Phone not accepting messages right now 09-27-2017 at 08:30 AM",
|
||||
False,
|
||||
),
|
||||
(
|
||||
"sms",
|
||||
"permanent-failure",
|
||||
"Not delivered 27 September at 08:30 US/Eastern",
|
||||
"Not delivered 09-27-2017 at 08:30 AM",
|
||||
False,
|
||||
),
|
||||
("sms", "delivered", "Delivered 27 September at 08:30 US/Eastern", True),
|
||||
("sms", "delivered", "Delivered 09-27-2017 at 08:30 AM", True),
|
||||
],
|
||||
)
|
||||
def test_sending_status_hint_displays_correctly_on_notifications_page(
|
||||
|
||||
@@ -90,7 +90,6 @@ def test_hiding_pages_from_search_engines(
|
||||
[
|
||||
"privacy",
|
||||
"pricing",
|
||||
"terms",
|
||||
"roadmap",
|
||||
"features",
|
||||
"documentation",
|
||||
@@ -167,7 +166,6 @@ def test_guidance_pages_link_to_service_pages_when_signed_in(
|
||||
("information_risk_management", "security"),
|
||||
("old_integration_testing", "integration_testing"),
|
||||
("old_roadmap", "roadmap"),
|
||||
("old_terms", "terms"),
|
||||
("information_security", "using_notify"),
|
||||
("old_using_notify", "using_notify"),
|
||||
("delivery_and_failure", "message_status"),
|
||||
@@ -226,12 +224,12 @@ def test_old_using_notify_page(client_request):
|
||||
# )
|
||||
|
||||
|
||||
def test_terms_page_has_correct_content(client_request):
|
||||
terms_page = client_request.get("main.terms")
|
||||
assert normalize_spaces(terms_page.select("main p")[0].text) == (
|
||||
"These terms apply to your service’s use of Notify.gov. "
|
||||
"You must be the service manager to accept them."
|
||||
)
|
||||
# def test_terms_page_has_correct_content(client_request):
|
||||
# terms_page = client_request.get("main.terms")
|
||||
# assert normalize_spaces(terms_page.select("main p")[0].text) == (
|
||||
# "These terms apply to your service’s use of Notify.gov. "
|
||||
# "You must be the service manager to accept them."
|
||||
# )
|
||||
|
||||
|
||||
def test_css_is_served_from_correct_path(client_request):
|
||||
|
||||
@@ -90,7 +90,7 @@ def test_should_show_page_for_one_job(
|
||||
|
||||
assert page.h1.text.strip() == "thisisatest.csv"
|
||||
assert " ".join(page.find("tbody").find("tr").text.split()) == (
|
||||
"2021234567 template content Delivered 1 January at 06:09 US/Eastern"
|
||||
"2021234567 template content Delivered 01-01-2016 at 06:09 AM"
|
||||
)
|
||||
assert page.find("div", {"data-key": "notifications"})["data-resource"] == url_for(
|
||||
"main.view_job_updates",
|
||||
@@ -109,7 +109,7 @@ def test_should_show_page_for_one_job(
|
||||
assert page.find("span", {"id": "time-left"}).text == "Data available for 7 days"
|
||||
|
||||
assert normalize_spaces(page.select_one("tbody tr").text) == normalize_spaces(
|
||||
"2021234567 " "template content " "Delivered 1 January at 06:09 US/Eastern"
|
||||
"2021234567 " "template content " "Delivered 01-01-2016 at 06:09 AM"
|
||||
)
|
||||
assert page.select_one("tbody tr a")["href"] == url_for(
|
||||
"main.view_notification",
|
||||
@@ -424,8 +424,8 @@ def test_should_show_updates_for_one_job_as_json(
|
||||
assert "2021234567" in content["notifications"]
|
||||
assert "Status" in content["notifications"]
|
||||
assert "Delivered" in content["notifications"]
|
||||
assert "00:00" in content["notifications"]
|
||||
assert "Sent by Test User on 1 January at 00:00" in content["status"]
|
||||
assert "Sent by Test User on 01-01-2016 at 12:00 AM" in content["status"]
|
||||
assert "12:00" in content["notifications"]
|
||||
|
||||
|
||||
@freeze_time("2016-01-01 05:00:00.000001")
|
||||
@@ -466,8 +466,8 @@ def test_should_show_updates_for_scheduled_job_as_json(
|
||||
assert "2021234567" in content["notifications"]
|
||||
assert "Status" in content["notifications"]
|
||||
assert "Delivered" in content["notifications"]
|
||||
assert "00:00" in content["notifications"]
|
||||
assert "Sent by Test User on 1 June at 16:00" in content["status"]
|
||||
assert "Sent by Test User on 06-01-2016 at 04:00 PM" in content["status"]
|
||||
assert "12:00" in content["notifications"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -862,9 +862,9 @@ def test_should_show_page_if_prefilled_user_is_already_invited(
|
||||
mock_get_invites_for_service,
|
||||
platform_admin_user,
|
||||
):
|
||||
active_user_with_permission_to_other_service[
|
||||
"email_address"
|
||||
] = "user_1@testnotify.gsa.gov"
|
||||
active_user_with_permission_to_other_service["email_address"] = (
|
||||
"user_1@testnotify.gsa.gov"
|
||||
)
|
||||
client_request.login(platform_admin_user)
|
||||
mocker.patch(
|
||||
"app.models.user.user_api_client.get_user",
|
||||
|
||||
@@ -21,6 +21,9 @@ def test_render_sign_in_template_for_new_user(client_request):
|
||||
# Removing for the pilot
|
||||
# assert page.select('main a')[0].text == 'create one now'
|
||||
# assert page.select('main a')[0]['href'] == url_for('main.register')
|
||||
# TODO: Fix this test to be less brittle! If the Login.gov link is enabled,
|
||||
# then these indices need to be 1 instead of 0.
|
||||
# Currently it's not enabled for the test or production environments.
|
||||
assert page.select("main a")[0].text == "Forgot your password?"
|
||||
assert page.select("main a")[0]["href"] == url_for("main.forgot_password")
|
||||
assert "Sign in again" not in normalize_spaces(page.text)
|
||||
|
||||
@@ -31,9 +31,11 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
|
||||
"name": name,
|
||||
"id": folder_id or str(uuid.uuid4()),
|
||||
"parent_id": parent,
|
||||
"users_with_permission": users_with_permission
|
||||
if users_with_permission is not None
|
||||
else [sample_uuid()],
|
||||
"users_with_permission": (
|
||||
users_with_permission
|
||||
if users_with_permission is not None
|
||||
else [sample_uuid()]
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -128,7 +128,6 @@ EXCLUDED_ENDPOINTS = tuple(
|
||||
"old_integration_testing",
|
||||
"old_roadmap",
|
||||
"old_service_dashboard",
|
||||
"old_terms",
|
||||
"old_using_notify",
|
||||
"organization_billing",
|
||||
"organization_dashboard",
|
||||
@@ -207,7 +206,6 @@ EXCLUDED_ENDPOINTS = tuple(
|
||||
"suspend_service",
|
||||
"template_history",
|
||||
"template_usage",
|
||||
"terms",
|
||||
"tour_step",
|
||||
"trial_mode",
|
||||
"trial_mode_new",
|
||||
|
||||
Reference in New Issue
Block a user