test: InfoLive.Show heard-by stations path decoding
This commit is contained in:
parent
313c1171c0
commit
ee0830a7fc
1 changed files with 34 additions and 0 deletions
|
|
@ -256,6 +256,40 @@ defmodule AprsmeWeb.InfoLive.ShowFullRenderTest do
|
||||||
assert html =~ "Some comment text"
|
assert html =~ "Some comment text"
|
||||||
end
|
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
|
test "renders with a device identifier that matches a seeded device", %{conn: conn} do
|
||||||
# Seed a device that enrich_with_device_info can find
|
# Seed a device that enrich_with_device_info can find
|
||||||
Aprsme.Repo.delete_all(Aprsme.Devices)
|
Aprsme.Repo.delete_all(Aprsme.Devices)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue