more changes to notes

This commit is contained in:
2022-11-24 12:43:34 -05:00
parent 2ce4fe3cc8
commit a0a0697f2d
9 changed files with 102 additions and 21 deletions

View File

@ -119,5 +119,17 @@ defmodule MemexWeb.NoteLiveTest do
assert html =~ "#{@update_attrs |> Map.get("title")} saved"
assert html =~ "some updated content"
end
test "deletes note", %{conn: conn, note: note} do
{:ok, show_live, _html} = live(conn, Routes.note_show_path(conn, :show, note))
{:ok, index_live, _html} =
show_live
|> element("[data-qa=\"delete-note-#{note.id}\"]")
|> render_click()
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
refute has_element?(index_live, "#note-#{note.id}")
end
end
end