aprs.me/test/support/channel_case.ex
Graham McIntire 41cc642d7e
Fix compile warnings and add comprehensive mobile channel tests
- Fix unsubscribe_from_bounds -> unsubscribe (function doesn't exist)
- Fix search_callsign query to use 'lon' instead of 'lng' field
- Add comprehensive test suite for mobile channel:
  - Join and subscription tests
  - Bounds validation tests
  - Callsign search tests
  - Callsign tracking tests
  - Streaming packet tests
  - Packet data format tests
  - 29 tests total, all passing

Created test/support/channel_case.ex for channel testing infrastructure.

Generated with Claude Code https://claude.com/claude-code
2025-10-25 13:18:55 -05:00

35 lines
981 B
Elixir

defmodule AprsmeWeb.ChannelCase do
@moduledoc """
This module defines the test case to be used by
channel tests.
Such tests rely on `Phoenix.ChannelTest` and also
import other functionality to make it easier
to build common data structures and query the data layer.
Finally, if the test case interacts with the database,
we enable the SQL sandbox, so changes done to the database
are reverted at the end of every test. If you are using
PostgreSQL, you can even run database tests asynchronously
by setting `use AprsmeWeb.ChannelCase, async: true`, although
this option is not recommended for other databases.
"""
use ExUnit.CaseTemplate
using do
quote do
import AprsmeWeb.ChannelCase
# Import conveniences for testing with channels
import Phoenix.ChannelTest
# The default endpoint for testing
@endpoint AprsmeWeb.Endpoint
end
end
setup tags do
Aprsme.DataCase.setup_sandbox(tags)
:ok
end
end