Merge remote-tracking branch 'origin/main' into 170-userdata-for-profile-button
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Simon 2025-09-29 16:07:57 +02:00
commit d40bc0bb82
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
8 changed files with 406 additions and 0 deletions

View file

@ -0,0 +1,33 @@
defmodule MvWeb.Components.SearchBarComponentTest do
use MvWeb.ConnCase, async: true
import Phoenix.LiveViewTest
describe "SearchBarComponent" do
test "renders with placeholder", %{conn: conn} do
conn = conn_with_oidc_user(conn)
{:ok, view, _html} = live(conn, "/members")
assert has_element?(view, "input[placeholder='Search...']")
end
test "updates query when user types", %{conn: conn} do
conn = conn_with_oidc_user(conn)
{:ok, view, _html} = live(conn, "/members")
# simulate search input and check that other members are not listed
html =
view
|> element("form[role=search]")
|> render_change(%{"query" => "Friedrich"})
refute html =~ "Greta"
html =
view
|> element("form[role=search]")
|> render_change(%{"query" => "Greta"})
refute html =~ "Friedrich"
end
end
end