refactor: remove tests against basic framework functionalities
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
15d328afbf
commit
91f8bb03bc
4 changed files with 524 additions and 454 deletions
|
|
@ -30,14 +30,6 @@ defmodule MvWeb.UserLive.ShowTest do
|
|||
assert html =~ to_string(user.email)
|
||||
end
|
||||
|
||||
test "displays user email", %{conn: conn, user: user} do
|
||||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, _view, html} = live(conn, ~p"/users/#{user.id}")
|
||||
|
||||
assert html =~ to_string(user.email)
|
||||
assert html =~ gettext("Email")
|
||||
end
|
||||
|
||||
test "displays password authentication status when enabled", %{conn: conn} do
|
||||
user = create_test_user(%{email: "password-user@example.com", password: "test123"})
|
||||
conn = conn_with_oidc_user(conn)
|
||||
|
|
@ -102,36 +94,6 @@ defmodule MvWeb.UserLive.ShowTest do
|
|||
end
|
||||
end
|
||||
|
||||
describe "navigation" do
|
||||
test "back button navigates to user list", %{conn: conn, user: user} do
|
||||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, view, _html} = live(conn, ~p"/users/#{user.id}")
|
||||
|
||||
assert {:error, {:live_redirect, %{to: to}}} =
|
||||
view
|
||||
|> element(
|
||||
"a[aria-label='#{gettext("Back to users list")}'], button[aria-label='#{gettext("Back to users list")}']"
|
||||
)
|
||||
|> render_click()
|
||||
|
||||
assert to == "/users"
|
||||
end
|
||||
|
||||
test "edit button navigates to edit form", %{conn: conn, user: user} do
|
||||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, view, _html} = live(conn, ~p"/users/#{user.id}")
|
||||
|
||||
assert {:error, {:live_redirect, %{to: to}}} =
|
||||
view
|
||||
|> element(
|
||||
"a[href='/users/#{user.id}/edit?return_to=show'], button[href='/users/#{user.id}/edit?return_to=show']"
|
||||
)
|
||||
|> render_click()
|
||||
|
||||
assert to == "/users/#{user.id}/edit?return_to=show"
|
||||
end
|
||||
end
|
||||
|
||||
describe "error handling" do
|
||||
test "raises exception for invalid user ID", %{conn: conn} do
|
||||
invalid_id = Ecto.UUID.generate()
|
||||
|
|
@ -145,16 +107,6 @@ defmodule MvWeb.UserLive.ShowTest do
|
|||
end
|
||||
end
|
||||
|
||||
describe "page title" do
|
||||
test "sets correct page title", %{conn: conn, user: user} do
|
||||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, _view, html} = live(conn, ~p"/users/#{user.id}")
|
||||
|
||||
# Check that page title is set (might be in title tag or header)
|
||||
assert html =~ gettext("Show User") || html =~ to_string(user.email)
|
||||
end
|
||||
end
|
||||
|
||||
describe "system actor user" do
|
||||
test "redirects to user list when viewing system actor user", %{conn: conn} do
|
||||
system_actor = Mv.Helpers.SystemActor.get_system_actor()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue