test: InfoLive.Show PHG render paths
This commit is contained in:
parent
b3f5b98a70
commit
dcb759ecfa
1 changed files with 46 additions and 0 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue