LiveViewTest not adding creating elements and returning empty HTML

Hello all! New to the elixir forum and needing some help or guidance with LiveView tests. I am running into this error ** (ArgumentError) selector "#identification-7 a" did not return any element within: when attempting this test:


    test "updates identification in listing", %{conn: conn, identification: identification} do
      {:ok, index_live, _html} = live(conn, Routes.identification_index_path(conn, :index))

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

      assert_patch(index_live, Routes.identification_index_path(conn, :edit, identification))

      assert index_live
             |> form("#identification-form", identification: @invalid_attrs)
             |> render_change() =~ "can't be blank"

      {:ok, _, html} =
        index_live
        |> form("#identification-form", identification: @update_attrs)
        |> render_submit()
        |> follow_redirect(conn, Routes.identification_index_path(conn, :index))

      assert html =~ "Identification updated successfully"
      assert html =~ "some updated expiration_date"
    end

The line assert index_live |> element("#identification-#{identification.id} a", "Edit") |> render_click() =~ "Edit Identification"
is where things are giving that error. The HTML output shows that there are no elements in the table so it looks as if the test isn’t properly adding elements.

the identication schema that it is using has an association to a users table but the @update_attrs and @invalid_attrs correctly match the definitions.

Am i missing something? Any help would be appreciated.

Update: I found out that I introduced a new object to the assigns and the live_modal opts. When the user goes to the /index route I take their user token and add it as a new key in the assigns so that I could add a link that takes the user to the /status live route. I wanted it to render all the status from that specific user but the test doesn’t see that new key I added to the assigns which is why it won’t populate the table elements.

Hopefully this is helpful context

What does the test setup look like?