![]() I get that tests run concurrently and all that, but I thought a GenServer. Test/live_view_studio_web/live/sales_dashboard_live_test.exs:26: (test)įinished in 1.1 seconds (0.7s async, 0.4s sync) Benefits of LiveView Timing Transponder scoring: All printed laptimes are provided free. Reliable hardware, easy subscription management. Left: "Sales Dashboard\n 31\n \n New Orders\n \n $130\n \n Sales Amount\n \n 35%\n \n Satisfaction\n \n Refresh\n " The new standard in sports timing The TR2 Transponder is the newest and most innovative transponder for motorsports. Refute with =~ failed, both sides are exactly equalĬode: refute before_refresh =~ after_refresh Here is the test code, and note the debug statement at the top: test "refreshes when refresh button is pressed", %ġ) test refreshes after tick (LiveViewStudioWeb.SalesDashboardLiveTest) ![]() This is where my code differs from the lesson in that I am making a GenServer call instead of one to a regular module, and this is where my test is failing. Stats = GenServer.call(LiveViewStudio.SalesProducer, :get_stats) The button event is handled like: def handle_event("refresh", _, socket) do Liveview Timing will attempt to text the customer at the provided phone number. Here is the GenServer part of the SalesProducer module: def make_stats() doĭef handle_call(:get_stats, _from, state) doīack in the LiveView, the Refresh button is implemented as: The test as given in the lesson worked fine, but in order to practice using GenServer and PubSub I created a SalesProducer module that periodically broadcasts sales data over PubSub, but to make the manual Refresh button work, I also implemented a GenServer callback and this is where I am getting a strange timing issue. I am working through the Pragmatic Programmer LiveView course, and in lesson 22 Testing Messages, we are testing a Sales Dashboard that receives sales data from another module.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |