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:
@@ -4,6 +4,8 @@ defmodule MusicLibraryWeb.ScrobbleRulesLiveTest do
|
||||
import MusicLibrary.ScrobbleRulesFixtures
|
||||
import Phoenix.LiveViewTest, only: [render_change: 1, form: 3]
|
||||
|
||||
alias MusicLibrary.ScrobbleRules
|
||||
|
||||
defp create_scrobble_rule(_) do
|
||||
scrobble_rule = scrobble_rule_fixture()
|
||||
%{scrobble_rule: scrobble_rule}
|
||||
@@ -92,6 +94,10 @@ defmodule MusicLibraryWeb.ScrobbleRulesLiveTest do
|
||||
"Delete"
|
||||
)
|
||||
|> refute_has("#scrobble_rule-#{scrobble_rule.id}")
|
||||
|
||||
assert_raise Ecto.NoResultsError, fn ->
|
||||
ScrobbleRules.get_scrobble_rule!(scrobble_rule.id)
|
||||
end
|
||||
end
|
||||
|
||||
test "toggles rule enabled status", %{conn: conn, scrobble_rule: scrobble_rule} do
|
||||
|
||||
Reference in New Issue
Block a user