Display no results notice in import dialog
This commit is contained in:
@@ -24,9 +24,15 @@ defmodule MusicLibraryWeb.RecordLive.ImportComponent do
|
||||
phx-debounce="500"
|
||||
/>
|
||||
</.simple_form>
|
||||
<ul role="list" class="divide-y divide-gray-100">
|
||||
<ul :if={@release_groups !== []} role="list" class="divide-y divide-gray-100">
|
||||
<.result :for={release_group <- @release_groups} release_group={release_group} />
|
||||
</ul>
|
||||
<div
|
||||
:if={@release_groups == []}
|
||||
class="flex items-center justify-center h-32 text-sm text-gray-500"
|
||||
>
|
||||
No results
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
||||
@@ -159,9 +159,13 @@ defmodule MusicLibraryWeb.RecordIndexTest do
|
||||
test "it shows the import modal", %{conn: conn} do
|
||||
{:ok, index_live, _html} = live(conn, ~p"/records")
|
||||
|
||||
assert index_live
|
||||
|> element("a", "Import")
|
||||
|> render_click() =~ "Search for a record on MusicBrainz"
|
||||
import_dialog =
|
||||
index_live
|
||||
|> element("a", "Import")
|
||||
|> render_click()
|
||||
|
||||
assert import_dialog =~ "Search for a record on MusicBrainz"
|
||||
assert import_dialog =~ "No results"
|
||||
|
||||
assert_patch(index_live, ~p"/records/import")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user