Fixing unit tests

This commit is contained in:
alexjanousekGSA
2025-08-08 19:45:29 -04:00
parent c6529ad453
commit 968697bf5b
8 changed files with 9 additions and 64 deletions

View File

@@ -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,
)

View File

@@ -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"

View File

@@ -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(

View File

@@ -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 (

View File

@@ -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)

View File

@@ -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):