Working through some tests

This commit is contained in:
Jonathan Bobel
2025-04-25 16:20:21 -04:00
parent 350526f4ad
commit cd40580231
6 changed files with 70 additions and 36 deletions

View File

@@ -1451,9 +1451,7 @@ def test_send_one_off_offers_link_to_upload(
assert back_link.text.strip() in {
"Back to all templates",
"Back to confirm your template",
"Back to select recipients",
"Back to message personalization"
"Back to confirm your template"
}
assert link.text.strip() == "Upload a list of phone numbers"
@@ -1524,8 +1522,6 @@ def test_link_to_upload_not_offered_when_entering_personalisation(
step_index=1,
)
# print(page.prettify()) # Print the full HTML response
# Were entering personalization
assert page.select_one("input[type=text]")["name"] == "placeholder_value"
assert page.select_one("label").text.strip() == "name"
@@ -2289,12 +2285,10 @@ def test_check_messages_back_link(
**extra_args,
)
# assert (page.find_all("a", {"class": "usa-back-link"})[0]["href"]) == expected_url(
# service_id=SERVICE_ONE_ID, template_id=fake_uuid
# )
actual_href = page.find_all("a", {"class": "usa-back-link"})[0]["href"]
expected_href = expected_url(service_id=SERVICE_ONE_ID, template_id=fake_uuid)
assert actual_href != "#", "Back link href fell back to '#' — missing correct back_link in view"
assert actual_href == expected_href
@@ -2723,8 +2717,15 @@ def test_preview_notification_shows_preview(
template_id=fake_uuid,
_expected_status=200,
)
assert page.h1.text.strip() == "Preview for sending"
assert (page.find_all("a", {"class": "usa-back-link"})[0]["href"]) == url_for(
back_link = page.find_all("a", {"class": "usa-back-link"})[0]
assert back_link is not None
# The real rendered <a href="..."> attribute
href = back_link["href"]
assert href == url_for(
"main.check_notification",
service_id=service_one["id"],
template_id=fake_uuid,