test updated
This commit is contained in:
parent
fdae610da0
commit
cf354bcf25
4 changed files with 16 additions and 16 deletions
|
|
@ -100,7 +100,7 @@ defmodule MvWeb.Layouts.NavbarTest do
|
|||
|
||||
# Verify the link actually works by navigating to it
|
||||
{:ok, _view, settings_html} = live(conn, ~p"/settings")
|
||||
assert settings_html =~ "Vereinsdaten"
|
||||
assert settings_html =~ "Club Settings"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
defmodule MvWeb.PageControllerTest do
|
||||
use MvWeb.ConnCase
|
||||
use MvWeb.ConnCase, async: true
|
||||
|
||||
test "GET /", %{conn: conn} do
|
||||
conn = conn_with_oidc_user(conn)
|
||||
test "renders home template successfully with authenticated user", %{conn: conn} do
|
||||
user = create_test_user(%{email: "test@example.com"})
|
||||
conn = conn_with_oidc_user(conn, user)
|
||||
conn = get(conn, "/")
|
||||
|
||||
conn = get(conn, ~p"/")
|
||||
assert html_response(conn, 200) =~ "Mitgliederverwaltung"
|
||||
assert html_response(conn, 200)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,16 +11,16 @@ defmodule MvWeb.GlobalSettingsLiveTest do
|
|||
end
|
||||
|
||||
test "renders the global settings page", %{conn: conn} do
|
||||
{:ok, view, html} = live(conn, ~p"/settings")
|
||||
{:ok, _view, html} = live(conn, ~p"/settings")
|
||||
|
||||
assert html =~ "Vereinsdaten"
|
||||
assert html =~ "Club Settings"
|
||||
assert html =~ "Settings"
|
||||
end
|
||||
|
||||
test "displays current club name", %{conn: conn} do
|
||||
# Set initial club name
|
||||
{:ok, settings} = Membership.get_settings()
|
||||
Membership.update_settings!(settings, %{club_name: "Test Club"})
|
||||
{:ok, _updated} = Membership.update_settings(settings, %{club_name: "Test Club"})
|
||||
|
||||
{:ok, _view, html} = live(conn, ~p"/settings")
|
||||
|
||||
|
|
@ -55,10 +55,11 @@ defmodule MvWeb.GlobalSettingsLiveTest do
|
|||
test "shows error when club_name is missing", %{conn: conn} do
|
||||
{:ok, view, _html} = live(conn, ~p"/settings")
|
||||
|
||||
# Submit form without club_name
|
||||
# Submit form with club_name explicitly set to empty string
|
||||
# (Phoenix forms will keep existing value if field is omitted)
|
||||
html =
|
||||
view
|
||||
|> form("#settings-form", %{setting: %{}})
|
||||
|> form("#settings-form", %{setting: %{club_name: ""}})
|
||||
|> render_submit()
|
||||
|
||||
assert html =~ "must be present"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue