ML-169.10.1: Add delete coverage
Cover current delete behavior across LiveView index and show paths, and strengthen existing delete tests with persistence assertions.\n\nValidation: mise run dev:precommit
This commit is contained in:
@@ -86,6 +86,22 @@ defmodule MusicLibraryWeb.ScrobbledTracksLiveTest do
|
||||
end
|
||||
end
|
||||
|
||||
describe "Delete track" do
|
||||
setup [:create_track]
|
||||
|
||||
test "deletes a scrobbled track from the listing", %{conn: conn, track: track} do
|
||||
conn
|
||||
|> visit(~p"/scrobbled-tracks")
|
||||
|> assert_has("p", track.title)
|
||||
|> click_button("button[data-confirm='Are you sure?']", "Delete")
|
||||
|> refute_has("p", track.title)
|
||||
|
||||
assert_raise Ecto.NoResultsError, fn ->
|
||||
ListeningStats.get_track!(track.scrobbled_at_uts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "Pagination" do
|
||||
test "navigates to next page", %{conn: conn} do
|
||||
create_test_tracks(21)
|
||||
|
||||
Reference in New Issue
Block a user