mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-03 13:18:57 -04:00
Fixing unit tests
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user