fix testing

This commit is contained in:
Beverly Nguyen
2025-04-18 11:27:07 -07:00
parent 34fdf7a1ca
commit 10c61440c9
2 changed files with 14 additions and 8 deletions

View File

@@ -7,9 +7,9 @@
alt="Mobile phone showing error screen"/>
</div>
<div class="desktop:grid-col-6 tablet:grid-col-12 padding-left-0 desktop:padding-left-5">
<p class="font-body-3xl line-height-sans-2 text-bold">
<h1 class="font-body-3xl line-height-sans-2 text-bold">
There's currently a technical issue.
</p>
</h1>
<p class="font-body-lg line-height-sans-2">Thank you for your patience while we work on it. Notify will be back soon.</p>
</div>
</div>

View File

@@ -16,16 +16,22 @@ def test_non_logged_in_user_can_see_homepage(
client_request.logout()
page = client_request.get("main.index", _test_page_title=False)
assert page.h1.text.strip() == (
"Reach people where they are with government-powered text messages"
)
heading = page.h1.text.strip()
assert heading in [
"Reach people where they are with government-powered text messages",
"There's currently a technical issue.",
]
# Assert the entire HTML of the button to include the image
button = page.select_one(
"a.usa-button.login-button.login-button--primary.margin-right-2"
)
assert "Sign in with" in button.text.strip() # Assert button text
assert button.find("img")["alt"] == "Login.gov logo" # Assert image presence
if heading == "There's currently a technical issue.":
assert button is None
else:
assert button is not None
assert "Sign in with" in button.text.strip()
assert button.find("img")["alt"] == "Login.gov logo"
assert page.select_one("meta[name=description]") is not None
assert page.select_one("#whos-using-notify a") is None