defmodule WhoNeedHelp.Workers.LocalBurstProbeTest do
  use ExUnit.Case, async: true
  use Oban.Testing, repo: WhoNeedHelp.Repo

  alias WhoNeedHelp.Workers.LocalBurstProbe

  test "accepts an explicitly confirmed isolated burst job" do
    assert :ok =
             perform_job(LocalBurstProbe, %{
               "confirmation" => "isolated-local-oban-burst-probe",
               "run_id" => "unit-burst",
               "sequence" => 1
             })
  end

  test "cancels jobs without the exact confirmation" do
    assert {:cancel, :invalid_local_burst_probe} =
             perform_job(LocalBurstProbe, %{
               "run_id" => "unit-burst",
               "sequence" => 1
             })
  end
end
