test: InfoLive.Show heard-by stations path decoding

This commit is contained in:
Graham McIntire 2026-04-24 08:20:46 -05:00
parent 313c1171c0
commit ee0830a7fc
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -256,6 +256,40 @@ defmodule AprsmeWeb.InfoLive.ShowFullRenderTest do
assert html =~ "Some comment text"
end
test "renders heard_by stations section when path has a digipeater", %{conn: conn} do
now = DateTime.utc_now()
# The station we'll view info for, with a path showing it was heard
# by digipeater K5ABC-1.
_heard =
packet_fixture(%{
sender: "HEARDME",
base_callsign: "HEARDME",
ssid: "0",
received_at: now,
lat: Decimal.new("33.0"),
lon: Decimal.new("-96.5"),
has_position: true,
path: "K5ABC-1*,WIDE1-1,qAO,T2TEXAS"
})
# The digipeater station itself, needed for ST_Distance calc
_digi =
packet_fixture(%{
sender: "K5ABC-1",
base_callsign: "K5ABC",
ssid: "1",
received_at: now,
lat: Decimal.new("33.5"),
lon: Decimal.new("-96.8"),
has_position: true,
path: ""
})
{:ok, _lv, html} = live(conn, ~p"/info/HEARDME", on_error: :warn)
assert html =~ "HEARDME"
end
test "renders with a device identifier that matches a seeded device", %{conn: conn} do
# Seed a device that enrich_with_device_info can find
Aprsme.Repo.delete_all(Aprsme.Devices)