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 =~ "47 GHz" 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