Problems regarding LiveView test

Without looking at the code being tested is hard to know the problem, but I still could say a few things to check:

test "redirected mount", %{conn: conn} do
  assert {:error, %{redirect: %{to: "/somewhere"}}} = live(conn, "my-path")
end

You may notice it matches the error you’re getting in another point of the test.

  • Based on the last part of your description (redirected to a normal view where he/she can print the shifts, after having clicked a print button), it is expected that the render_click helper, which is for live view components, is no longer useful when testing a button from another part of the application.

It would require to do some extra work to keep testing the whole flow. Maybe this discussion has some insight

2 Likes