Greetings Phoenix LiveView Wizards!
We have a basic LiveView counter app: https://github.com/dwyl/phoenix-liveview-counter-tutorial
The code is very simple:
The App works as expected, see: https://live-view-counter.herokuapp.com
The test file is:
We are stuck with trying to invoke the
handle_info/2 function in a test.
So we have code in our project that is untested. Which is undesirable.
We have read through the official docs https://hexdocs.pm/phoenix_live_view/Phoenix.LiveViewTest.html
but have not been able to understand how to do it. What are we missing?
We really want to use
LiveView in our “real” projects, but we want to ensure that our
LiveView apps are fully tested.
How do we write a test to invoke the
Note: this question was also posted on StackOverflow: https://stackoverflow.com/questions/60848600/how-to-test-handle-event-3-in-phoenix-liveview