diff --git a/lib/music_library_web/live/collection_live/show.html.heex b/lib/music_library_web/live/collection_live/show.html.heex
index 118a0cb2..91083a78 100644
--- a/lib/music_library_web/live/collection_live/show.html.heex
+++ b/lib/music_library_web/live/collection_live/show.html.heex
@@ -324,7 +324,7 @@
>
{medium_title(medium)}
-
+
-
+ Req.Test.json(conn, release_response)
+ end)
+
+ session =
+ conn
+ |> visit(~p"/collection/#{record.id}")
+ |> assert_has("button", text: "Show Tracks")
+ |> unwrap(fn view ->
+ # we can't directly click the "Show Tracks" button as
+ # its phx-click event uses a JS command. Bit of a hack, but we can simulate
+ # the click by pretending we're dealing with a JS hook, and trigger the event
+ # that is sent by the JS command.
+ view
+ |> Phoenix.LiveViewTest.render_hook(:load_release_with_tracks, %{})
+ end)
+ |> assert_has("a", text: "Connect your Last.fm account")
+
+ release =
+ MusicBrainz.Release.from_api_response(release_response)
+
+ for medium <- release.media do
+ session
+ |> within("#disc-#{medium.number}", fn inner_session ->
+ for track <- medium.tracks do
+ inner_session
+ |> assert_has("li", text: escape(track.title))
+ end
+
+ inner_session
+ end)
+ end
+ end
+ end
end