Extract LiveView async test helper

This commit is contained in:
Claudio Ortolina
2026-05-16 22:27:46 +01:00
parent 4fa05d6ad1
commit 90ac4fa23a
10 changed files with 90 additions and 49 deletions
@@ -20,7 +20,7 @@ defmodule MusicLibraryWeb.CollectionLive.ShowTest do
conn
|> visit(~p"/collection/#{record.id}")
|> unwrap(&render_async/1)
|> render_async()
|> assert_has("a", "Edit")
|> click_link("Edit")
|> assert_path(~p"/collection/#{record}/show/edit")
@@ -43,7 +43,7 @@ defmodule MusicLibraryWeb.CollectionLive.ShowTest do
session =
conn
|> visit(~p"/collection/#{record.id}")
|> unwrap(&render_async/1)
|> render_async()
|> assert_has("h2", escape(record.title))
|> assert_has("p", record.release_date)
|> assert_has("p", format_label(record.format))
@@ -82,7 +82,7 @@ defmodule MusicLibraryWeb.CollectionLive.ShowTest do
conn
|> visit(~p"/collection/#{record.id}")
|> assert_has("button", "Show Tracks")
|> unwrap(&render_async/1)
|> render_async()
|> assert_has("a", "Connect Last.fm")
release =