test: update test for search bar component
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
e68e1604a4
commit
2095d9b0da
3 changed files with 3 additions and 5 deletions
|
|
@ -8,7 +8,7 @@ defmodule MvWeb.Components.SearchBarComponent do
|
|||
use MvWeb, :live_component
|
||||
|
||||
@impl true
|
||||
def update(assigns, socket) do
|
||||
def update(_assigns, socket) do
|
||||
socket =
|
||||
socket
|
||||
|> assign_new(:query, fn -> "" end)
|
||||
|
|
|
|||
|
|
@ -14,15 +14,14 @@ defmodule MvWeb.Components.SearchBarComponentTest do
|
|||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, view, _html} = live(conn, "/members")
|
||||
|
||||
# simulate search input and check that correct user is listed
|
||||
# simulate search input and check that other members are not listed
|
||||
html =
|
||||
view
|
||||
|> element("form[role=search]")
|
||||
|> render_change(%{"query" => "Friedrich"})
|
||||
|
||||
assert html =~ "Friedrich"
|
||||
refute html =~ "Greta"
|
||||
|
||||
# simulate search input and check that not matching user is not shown
|
||||
html =
|
||||
view
|
||||
|> element("form[role=search]")
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ defmodule MvWeb.MemberLive.IndexTest do
|
|||
|
||||
send(view.pid, {:search_changed, "Friedrich"})
|
||||
|
||||
# State aus dem LiveView-Prozess holen
|
||||
state = :sys.get_state(view.pid)
|
||||
|
||||
assert state.socket.assigns.query == "Friedrich"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue