feat: conditional navbar — shows username/logout when logged in

This commit is contained in:
Oliver Hofmann
2026-04-27 13:48:50 +02:00
parent 9e8778f015
commit ffa037e240
2 changed files with 27 additions and 5 deletions
+13
View File
@@ -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