# /to-issues routing wiring (issue #16): spec-slice output honors the
# tracker key per the ADR'd boundary (git issues = specs, Planka = state).
require_relative "test_helper"

class IssuesRoutingTest < Minitest::Test
  def test_forgejo_tracker_routes_spec_slices_to_git_issues
    assert_equal :git_issues, Backlog::Tracker.issues_destination("forgejo:jared/cc-os")
  end

  def test_github_tracker_routes_spec_slices_to_git_issues
    assert_equal :git_issues, Backlog::Tracker.issues_destination("github:jared/some-repo")
  end

  def test_planka_tracker_is_the_gated_default
    assert_equal :planka_default, Backlog::Tracker.issues_destination("planka:cc-os")
  end

  def test_repo_tracker_is_the_gated_default
    assert_equal :planka_default, Backlog::Tracker.issues_destination("repo:docs/issues")
  end

  def test_absent_tracker_is_the_gated_default
    assert_equal :planka_default, Backlog::Tracker.issues_destination(nil)
  end

  def test_invalid_tracker_is_unrouted
    assert_equal :unrouted, Backlog::Tracker.issues_destination("jira:whatever")
  end
end
