Skip to content

Commit

Permalink
Add test for empty search results; fixes coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
hackartisan committed Jan 9, 2025
1 parent 392a48f commit 3f2710b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/dpul_collections_web/live/search_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ defmodule DpulCollectionsWeb.SearchLiveTest do
|> Enum.any?()
end

test "GET /search with a query that has no results", %{conn: conn} do
{:ok, view, _html} = live(conn, "/search?q=therewontbeanyresults")

assert view
|> has_element?(
"#item-counter",
"No items found"
)
end

test "GET /search renders thumbnails for each resource", %{conn: conn} do
{:ok, view, _html} = live(conn, "/search?")

Expand Down

0 comments on commit 3f2710b

Please sign in to comment.