defmodule MicrowavepropWeb.MapLiveTest do use MicrowavepropWeb.ConnCase, async: true import Phoenix.LiveViewTest describe "mount" do test "renders full-page map", %{conn: conn} do {:ok, _lv, html} = live(conn, ~p"/map") assert html =~ ~s(id="propagation-map") assert html =~ ~s(phx-hook="PropagationMap") end test "renders band dropdown with all bands", %{conn: conn} do {:ok, _lv, html} = live(conn, ~p"/map") assert html =~ "10 GHz" assert html =~ "24 GHz" assert html =~ "47 GHz" assert html =~ "75 GHz" assert html =~ "241 GHz" end test "defaults to 10 GHz selected", %{conn: conn} do {:ok, _lv, html} = live(conn, ~p"/map") assert html =~ ~s(class="active") end test "includes data-scores attribute", %{conn: conn} do {:ok, _lv, html} = live(conn, ~p"/map") assert html =~ "data-scores" 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