Vendor Leaflet 1.9.4 (JS, CSS, marker images) and wire it into the esbuild/Tailwind asset pipeline. Create MapLive with band selector buttons, auto-refresh, and a colocated JS hook that renders propagation scores as color-coded circle markers with a legend. Stub Propagation context and BandConfig modules provide the data interface for the scoring pipeline. Add nav bar with links to Map, QSOs, and Submit pages.
46 lines
1.2 KiB
Elixir
46 lines
1.2 KiB
Elixir
defmodule MicrowavepropWeb.MapLiveTest do
|
|
use MicrowavepropWeb.ConnCase, async: true
|
|
|
|
import Phoenix.LiveViewTest
|
|
|
|
describe "mount" do
|
|
test "renders the propagation map page", %{conn: conn} do
|
|
{:ok, _lv, html} = live(conn, ~p"/map")
|
|
assert html =~ "Propagation Map"
|
|
assert html =~ "propagation-map"
|
|
end
|
|
|
|
test "renders all band selector buttons", %{conn: conn} do
|
|
{:ok, _lv, html} = live(conn, ~p"/map")
|
|
assert html =~ "10 GHz"
|
|
assert html =~ "24 GHz"
|
|
assert html =~ "1296 MHz"
|
|
assert html =~ "75 GHz"
|
|
end
|
|
|
|
test "defaults to 10 GHz band selected", %{conn: conn} do
|
|
{:ok, _lv, html} = live(conn, ~p"/map")
|
|
assert html =~ "btn-primary"
|
|
end
|
|
|
|
test "includes map container with data-scores", %{conn: conn} do
|
|
{:ok, _lv, html} = live(conn, ~p"/map")
|
|
assert html =~ ~s(id="propagation-map")
|
|
assert html =~ "data-scores"
|
|
assert html =~ "phx-hook"
|
|
end
|
|
end
|
|
|
|
describe "select_band" do
|
|
test "updates selected band on click", %{conn: conn} do
|
|
{:ok, lv, _html} = live(conn, ~p"/map")
|
|
|
|
html =
|
|
lv
|
|
|> element("button[value='24000']")
|
|
|> render_click()
|
|
|
|
assert html =~ "24 GHz"
|
|
end
|
|
end
|
|
end
|