test: InfoLive.Show PHG render paths

This commit is contained in:
Graham McIntire 2026-04-24 08:59:34 -05:00
parent b3f5b98a70
commit dcb759ecfa
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -256,6 +256,52 @@ defmodule AprsmeWeb.InfoLive.ShowFullRenderTest do
assert html =~ "Some comment text"
end
test "renders PHG (Power-Height-Gain) data when present", %{conn: conn} do
_packet =
packet_fixture(%{
sender: "PHG1",
base_callsign: "PHG1",
ssid: "0",
received_at: DateTime.utc_now(),
lat: Decimal.new("33.0"),
lon: Decimal.new("-96.5"),
has_position: true,
data: %{
"phg_power" => 9,
"phg_height" => 30,
"phg_gain" => 3,
"phg_directivity" => 0
},
path: "WIDE1-1"
})
{:ok, _lv, html} = live(conn, ~p"/info/PHG1", on_error: :warn)
assert html =~ "PHG1"
# Power-Height-Gain section renders when phg_ fields are present.
assert html =~ "PHG" or html =~ "Power"
end
test "renders PHG with non-omni directivity", %{conn: conn} do
_packet =
packet_fixture(%{
sender: "PHG2",
base_callsign: "PHG2",
ssid: "0",
received_at: DateTime.utc_now(),
lat: Decimal.new("33.0"),
lon: Decimal.new("-96.5"),
has_position: true,
data: %{
"phg_power" => 25,
"phg_directivity" => 90
},
path: ""
})
{:ok, _lv, html} = live(conn, ~p"/info/PHG2", on_error: :warn)
assert html =~ "PHG2"
end
test "renders heard_by stations section when path has a digipeater", %{conn: conn} do
now = DateTime.utc_now()