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)
| 170 | // labels produces a mapped intent record. |
| 171 | // Spec: "Resolver.ResolveIssue — resolves intent for an issue using its labels." |
| 172 | func 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. |
nothing calls this directly
no test coverage detected