test: MapLive.Index invalid-bounds rejection

This commit is contained in:
Graham McIntire 2026-04-24 09:01:47 -05:00
parent b8bbfaaaaa
commit cde015deca
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -788,6 +788,23 @@ defmodule AprsmeWeb.MapLive.IndexTest do
assert Process.alive?(view.pid)
end
test "invalid bounds (north <= south) is rejected silently", %{conn: conn} do
{:ok, view, _html} = live(conn, "/", on_error: :warn)
# north <= south → invalid; the update should be silently skipped.
bounds_params = %{
"bounds" => %{
"north" => 30.0,
"south" => 40.0,
"east" => -95.0,
"west" => -97.0
}
}
assert render_hook(view, "bounds_changed", bounds_params)
assert Process.alive?(view.pid)
end
test "handles load_rf_path_station_packets with empty list", %{conn: conn} do
{:ok, view, _html} = live(conn, "/", on_error: :warn)
send(view.pid, {:load_rf_path_station_packets, []})