Without looking at the code being tested is hard to know the problem, but I still could say a few things to check:
- I don’t know how good is the support to test redirections in live view, but we have one example from the docs : phoenix_live_view/lib/phoenix_live_view/test/live_view_test.ex at main · phoenixframework/phoenix_live_view · GitHub
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 therender_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