From 968697bf5b2aa8cf963de74343cd3cd8d59c9aa0 Mon Sep 17 00:00:00 2001 From: alexjanousekGSA Date: Fri, 8 Aug 2025 19:45:29 -0400 Subject: [PATCH] Fixing unit tests --- app/templates/views/pricing/how-to-pay.html | 52 ------------------- app/templates/views/templates/choose.html | 2 +- tests/app/main/test_permissions.py | 1 + .../views/organizations/test_organizations.py | 4 +- tests/app/main/views/test_api_integration.py | 7 +-- tests/app/main/views/test_conversation.py | 2 +- tests/app/main/views/test_history.py | 4 +- tests/app/main/views/test_index.py | 1 - 8 files changed, 9 insertions(+), 64 deletions(-) diff --git a/app/templates/views/pricing/how-to-pay.html b/app/templates/views/pricing/how-to-pay.html index 4cc5d3746..c239bcba3 100644 --- a/app/templates/views/pricing/how-to-pay.html +++ b/app/templates/views/pricing/how-to-pay.html @@ -9,56 +9,4 @@ {{ page_header('How to pay') }} - - {% endblock %} diff --git a/app/templates/views/templates/choose.html b/app/templates/views/templates/choose.html index 43fa21c0f..810064310 100644 --- a/app/templates/views/templates/choose.html +++ b/app/templates/views/templates/choose.html @@ -33,7 +33,7 @@
-

{{page_title}}

+

{{page_title}}

diff --git a/tests/app/main/test_permissions.py b/tests/app/main/test_permissions.py index bf807bfad..090e6cf3b 100644 --- a/tests/app/main/test_permissions.py +++ b/tests/app/main/test_permissions.py @@ -181,6 +181,7 @@ def test_service_user_without_manage_service_permission_can_see_usage_page_when_ "main.usage", service_id=SERVICE_ONE_ID, _expected_status=expected_status, + _test_page_title=False if expected_status == 403 else True, ) diff --git a/tests/app/main/views/organizations/test_organizations.py b/tests/app/main/views/organizations/test_organizations.py index 0e7c35e82..6e34dd8aa 100644 --- a/tests/app/main/views/organizations/test_organizations.py +++ b/tests/app/main/views/organizations/test_organizations.py @@ -27,7 +27,7 @@ def test_organization_page_shows_all_organizations( "app.models.organization.AllOrganizations.client_method", return_value=orgs ) client_request.login(platform_admin_user) - page = client_request.get(".organizations") + page = client_request.get("main.organizations") assert normalize_spaces(page.select_one("h1").text) == "Organizations" @@ -59,7 +59,7 @@ def test_organization_page_shows_all_organizations( ), ] - archived = page.select_one(".table-field-status-default.heading-medium") + archived = page.select_one(".table-field-status-default.font-heading-lg") assert normalize_spaces(archived.text) == "- archived" assert normalize_spaces(archived.parent.text) == "Test 2 - archived 2 live services" diff --git a/tests/app/main/views/test_api_integration.py b/tests/app/main/views/test_api_integration.py index f482b1cce..2943a6c2e 100644 --- a/tests/app/main/views/test_api_integration.py +++ b/tests/app/main/views/test_api_integration.py @@ -25,13 +25,10 @@ def test_should_show_api_page( service_id=SERVICE_ONE_ID, ) assert page.h1.string.strip() == "API integration" - rows = page.find_all("details") + rows = page.find_all("div", {"class": "usa-accordion api-notifications-item"}) assert len(rows) == 5 for row in rows: - assert ( - row.select("h3 .govuk-details__summary-text")[0].string.strip() - == "2021234567" - ) + assert row.select("button span")[0].string.strip() == "2021234567" def test_should_show_api_page_with_lots_of_notifications( diff --git a/tests/app/main/views/test_conversation.py b/tests/app/main/views/test_conversation.py index 389af5930..4177f8e21 100644 --- a/tests/app/main/views/test_conversation.py +++ b/tests/app/main/views/test_conversation.py @@ -277,7 +277,7 @@ def test_conversation_reply_shows_link_to_add_templates_if_service_has_no_templa service_id=SERVICE_ONE_ID, notification_id=fake_uuid, ) - page_text = page.find("p", class_="bottom-gutter").text + page_text = page.find("p", class_="margin-bottom-3").text link = page.find("a", text=re.compile("Add a new template"))["href"] assert ( diff --git a/tests/app/main/views/test_history.py b/tests/app/main/views/test_history.py index 7f4e482b4..72d9e9499 100644 --- a/tests/app/main/views/test_history.py +++ b/tests/app/main/views/test_history.py @@ -97,8 +97,8 @@ def test_history( assert page.select_one("h1").text == "Audit events" - headings = page.select("main h2.heading-small") - events = page.select("main ul.bottom-gutter") + headings = page.select("main h2.font-heading-md") + events = page.select("main ul.margin-bottom-3") assert len(headings) == len(events) == len(expected_headings_and_events) diff --git a/tests/app/main/views/test_index.py b/tests/app/main/views/test_index.py index a97eec4f6..b823d0df8 100644 --- a/tests/app/main/views/test_index.py +++ b/tests/app/main/views/test_index.py @@ -103,7 +103,6 @@ def test_hiding_pages_from_search_engines( "create_and_send_messages", "edit_and_format_messages", "send_files_by_email", - "billing_details", ], ) def test_static_pages(client_request, mock_get_organization_by_domain, view, mocker):