LiveViewTest render_click() not patching a link

Just to be clear, are the Edit and Index routes using the same LiveView? If not, you don’t want to be using patch, and instead navigate is what you want.

Is there any async stuff happening that needs to resolve before asserting on presence of elements? If so, render_async can help:

      assert index_live 
             |> element("#branches-#{branch.id} a", "Edit") 
             |> render_click() =~ "Edit"

      render_async(index_live)

      assert index_live
             |> form("#branch-form", branch: @invalid_attrs)
             |> render_change() =~ "Cannot be empty"