diff --git a/test/microwaveprop_web/live/weather_map_live_test.exs b/test/microwaveprop_web/live/weather_map_live_test.exs index 37c68e2d..6d510ad2 100644 --- a/test/microwaveprop_web/live/weather_map_live_test.exs +++ b/test/microwaveprop_web/live/weather_map_live_test.exs @@ -83,7 +83,12 @@ defmodule MicrowavepropWeb.WeatherMapLiveTest do |> Map.put(:second, 0) stale_t = DateTime.add(now, -2 * 3600, :second) - recent_t = DateTime.add(now, -30 * 60, :second) + # `now` is truncated to the top of the hour; real `utc_now()` is up to + # 60 min ahead of that, so a `now - 30 min` recent_t is 30-90 min old + # of real time and the LiveView's `utc_now() - 1h` cutoff filters it + # out 50% of the time. Anchor recent_t at the top of the current hour + # — that's always within the 1-hour window regardless of minute. + recent_t = now future_t = DateTime.add(now, 3 * 3600, :second) Enum.each([stale_t, recent_t, future_t], &write_profile(&1, 33.0, -97.0))