Hey,
I’m writing tests for Phoenix LiveView and found out that element/3 function is quite convenient to assert that page has certain elements.
Right now I can write something like this
assert view |> element(“table td", "text") |> has_element?()
The issue I have is I want to test a result of change_element/2 function like this as well
html =
view
|> element("#filter-form")
|> render_change(%{filter: %{days: "14"}})
|> element("table td", “text")
|> has_element?()
For now I can use Floki to write something like this
Floki.find(“.target") |> Emum.find(&has_test(&1, "text"))
It would be great if it would be possible to use element/2 with html input.