defmodule AprsmeWeb.InfoLive.ShowIntegrationTest do
  use AprsmeWeb.ConnCase

  import Phoenix.LiveViewTest

  describe "InfoLive.Show via HTTP" do
    test "renders the station info page for a callsign", %{conn: conn} do
      # The LiveView mount fetches the latest packet from the DB; without data
      # it renders a "no packets" view.
      {:ok, _lv, html} = live(conn, ~p"/info/N0CALL", on_error: :warn)
      assert html =~ "N0CALL"
    end

    test "normalizes lowercase callsigns to uppercase", %{conn: conn} do
      {:ok, _lv, html} = live(conn, ~p"/info/k1abc", on_error: :warn)
      assert html =~ "K1ABC"
    end
  end
end
