feat: conditional navbar — shows username/logout when logged in
This commit is contained in:
@@ -77,3 +77,16 @@ def test_landing_contains_title(client):
|
||||
def test_landing_info_strip_shows_db_mode(client, auth_cookies):
|
||||
response = client.get("/", cookies=auth_cookies)
|
||||
assert "SQLite" in response.text or "MariaDB" in response.text
|
||||
|
||||
|
||||
def test_navbar_shows_login_button_for_anonymous(client):
|
||||
response = client.get("/")
|
||||
assert "Anmelden" in response.text
|
||||
assert "Abmelden" not in response.text
|
||||
|
||||
|
||||
def test_navbar_shows_username_and_logout_when_logged_in(client, auth_cookies):
|
||||
response = client.get("/", cookies=auth_cookies)
|
||||
assert "testuser" in response.text
|
||||
assert "Abmelden" in response.text
|
||||
assert "Anmelden" not in response.text
|
||||
|
||||
Reference in New Issue
Block a user