test(backfill): verify pos1/pos2 are derived from grids before status-marking
This commit is contained in:
parent
9950aa11c2
commit
c78cb977a0
1 changed files with 17 additions and 0 deletions
|
|
@ -682,6 +682,23 @@ defmodule Microwaveprop.Workers.ContactWeatherEnqueueWorkerTest do
|
|||
assert updated.iemre_status == :queued
|
||||
end
|
||||
|
||||
test "derives pos1/pos2 from grid1/grid2 when missing, then queues path enrichments" do
|
||||
_station = create_asos_station("KDFW", 32.90, -97.04)
|
||||
# Historical rows can have grids without lat/lon maps; ensure_positions!/1
|
||||
# must fill them in before path enrichments get a chance to mark :unavailable.
|
||||
contact = create_contact(%{pos1: nil, pos2: nil, grid1: "EM12", grid2: "EM00"})
|
||||
assert is_nil(contact.pos1)
|
||||
assert is_nil(contact.pos2)
|
||||
|
||||
assert :ok = ContactWeatherEnqueueWorker.enqueue_for_contact(contact)
|
||||
|
||||
updated = Repo.get!(Contact, contact.id)
|
||||
assert updated.pos1
|
||||
assert updated.pos2
|
||||
assert updated.terrain_status == :queued
|
||||
assert updated.radar_status == :queued
|
||||
end
|
||||
|
||||
test "works for QSO without pos2 or grid2 (path statuses flip to :unavailable)" do
|
||||
_station = create_asos_station("KDFW", 32.90, -97.04)
|
||||
contact = create_contact(%{pos2: nil, grid2: nil})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue