MCPcopy Create free account
hub / github.com/github/gh-aw / TestSpec_PublicAPI_ResolveIssue_Mapped

Function TestSpec_PublicAPI_ResolveIssue_Mapped

pkg/intent/spec_test.go:172–191  ·  view source on GitHub ↗

TestSpec_PublicAPI_ResolveIssue_Mapped validates that an issue with matching labels produces a mapped intent record. Spec: "Resolver.ResolveIssue — resolves intent for an issue using its labels."

(t *testing.T)

Source from the content-addressed store, hash-verified

170// labels produces a mapped intent record.
171// Spec: "Resolver.ResolveIssue — resolves intent for an issue using its labels."
172func TestSpec_PublicAPI_ResolveIssue_Mapped(t *testing.T) {
173 resolver := intent.Resolver{
174 MatchLabels: func(labels []string) []string { return labels },
175 }
176
177 record := resolver.ResolveIssue(
178 "I_kwDOAAABCQ4",
179 "https://github.com/owner/repo/issues/42",
180 []string{"security"},
181 )
182
183 assert.Equal(t, intent.AttributionMapped, record.Status,
184 "issue with matching labels should produce mapped status")
185 assert.Equal(t, intent.SourceIssueLabels, record.Source,
186 "ResolveIssue should produce issue_labels source")
187 assert.Equal(t, "issue_label_fallback", record.Rule,
188 "ResolveIssue should produce issue_label_fallback rule")
189 assert.Equal(t, "issue", record.RootType,
190 "ResolveIssue should set RootType to issue")
191}
192
193// TestSpec_PublicAPI_ResolveIssue_NoLabelsUnlinked validates that an issue with
194// no labels produces an unlinked record.

Callers

nothing calls this directly

Calls 1

ResolveIssueMethod · 0.95

Tested by

no test coverage detected