adds tests
This commit is contained in:
parent
a132383d81
commit
418b42d35a
4 changed files with 199 additions and 0 deletions
|
|
@ -84,5 +84,23 @@ defmodule MvWeb.Layouts.NavbarTest do
|
|||
# Check for correct logout path
|
||||
assert html =~ ~s(href="/sign-out")
|
||||
end
|
||||
|
||||
test "Settings link navigates to global settings page", %{conn: conn} do
|
||||
user = create_test_user(%{email: "test@example.com"})
|
||||
conn = conn_with_oidc_user(conn, user)
|
||||
|
||||
html =
|
||||
render_component(&MvWeb.Layouts.Navbar.navbar/1, %{
|
||||
current_user: user
|
||||
})
|
||||
|
||||
# Check that Settings link exists and points to /settings
|
||||
assert html =~ "Settings"
|
||||
assert html =~ ~s(href="/settings") || html =~ ~s(navigate="/settings")
|
||||
|
||||
# Verify the link actually works by navigating to it
|
||||
{:ok, _view, settings_html} = live(conn, ~p"/settings")
|
||||
assert settings_html =~ "Vereinsdaten"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue