* test(create): guard external-ref prelinking GH#3254 is already implemented on current main, but a narrow builder-level test makes the explicit external_ref pre-linking behavior harder to regress while the larger Linear roadmap remains open. _codex-gpt-5.5-medium on behalf of matt wilkie_ * test(create): avoid nil deref in ExternalRef failure-path Fatalf Print the pointer instead of dereferencing it in the failure branch of TestBuildCreateIssueEmptyExternalRefIsNil so the test does not nil-deref while reporting a failure. _claude-opus-4-7-medium on behalf of matt wilkie_
37 lines
851 B
Go
37 lines
851 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/steveyegge/beads/internal/types"
|
|
)
|
|
|
|
func TestBuildCreateIssueExternalRefPrelink(t *testing.T) {
|
|
ref := "https://linear.app/team/issue/TEAM-123/fix-login"
|
|
|
|
issue := buildCreateIssue(createIssueParams{
|
|
Title: "Pre-linked Linear issue",
|
|
Priority: 2,
|
|
IssueType: types.TypeTask,
|
|
ExternalRef: ref,
|
|
})
|
|
|
|
if issue.ExternalRef == nil {
|
|
t.Fatal("ExternalRef is nil, want pre-linked Linear URL")
|
|
}
|
|
if *issue.ExternalRef != ref {
|
|
t.Fatalf("ExternalRef = %q, want %q", *issue.ExternalRef, ref)
|
|
}
|
|
}
|
|
|
|
func TestBuildCreateIssueEmptyExternalRefIsNil(t *testing.T) {
|
|
issue := buildCreateIssue(createIssueParams{
|
|
Title: "Local-only issue",
|
|
Priority: 2,
|
|
IssueType: types.TypeTask,
|
|
})
|
|
|
|
if issue.ExternalRef != nil {
|
|
t.Fatalf("ExternalRef = %v, want nil", issue.ExternalRef)
|
|
}
|
|
}
|