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 9358b86..c9a0053 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,41 @@ defmodule AprsmeWeb.InfoLive.ShowFullRenderTest do assert html =~ "Some comment text" 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) + + Aprsme.Repo.insert!(%Aprsme.Devices{ + identifier: "APTESTX", + vendor: "TestVendor", + model: "TestModel", + contact: "test@example.com", + class: "Tracker" + }) + + devices = Aprsme.Repo.all(Aprsme.Devices) + Aprsme.Cache.put(:device_cache, :all_devices, devices) + + _packet = + packet_fixture(%{ + sender: "WITHDEV", + base_callsign: "WITHDEV", + ssid: "0", + destination: "APTESTX", + device_identifier: "APTESTX", + received_at: DateTime.utc_now(), + lat: Decimal.new("33.0"), + lon: Decimal.new("-96.5"), + has_position: true, + path: "WIDE1-1" + }) + + {:ok, _lv, html} = live(conn, ~p"/info/WITHDEV", on_error: :warn) + + # The device enrichment should add vendor/model to the rendered page. + assert html =~ "WITHDEV" + end + test "renders a packet with an object_name", %{conn: conn} do _packet = packet_fixture(%{