From ee0830a7fcc2f9eada6e72ea2c24838dd004f56a Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 24 Apr 2026 08:20:46 -0500 Subject: [PATCH] test: InfoLive.Show heard-by stations path decoding --- .../live/info_live/show_full_render_test.exs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/test/aprsme_web/live/info_live/show_full_render_test.exs b/test/aprsme_web/live/info_live/show_full_render_test.exs index c9a0053..0194eed 100644 --- a/test/aprsme_web/live/info_live/show_full_render_test.exs +++ b/test/aprsme_web/live/info_live/show_full_render_test.exs @@ -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)