MCPcopy
hub / github.com/cli/cli / TestIssueCreate_metadata

Function TestIssueCreate_metadata

pkg/cmd/issue/create/create_test.go:1252–1360  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1250}
1251
1252func TestIssueCreate_metadata(t *testing.T) {
1253 http := &httpmock.Registry{}
1254 defer http.Verify(t)
1255
1256 http.StubIssueRepoInfoResponse("OWNER", "REPO")
1257 http.Register(
1258 httpmock.GraphQL(`query RepositoryLabelList\b`),
1259 httpmock.StringResponse(`
1260 { "data": { "repository": { "labels": {
1261 "nodes": [
1262 { "name": "TODO", "id": "TODOID" },
1263 { "name": "bug", "id": "BUGID" }
1264 ],
1265 "pageInfo": { "hasNextPage": false }
1266 } } } }
1267 `))
1268 http.Register(
1269 httpmock.GraphQL(`query RepositoryMilestoneList\b`),
1270 httpmock.StringResponse(`
1271 { "data": { "repository": { "milestones": {
1272 "nodes": [
1273 { "title": "GA", "id": "GAID" },
1274 { "title": "Big One.oh", "id": "BIGONEID" }
1275 ],
1276 "pageInfo": { "hasNextPage": false }
1277 } } } }
1278 `))
1279 http.Register(
1280 httpmock.GraphQL(`query RepositoryProjectList\b`),
1281 httpmock.StringResponse(`
1282 { "data": { "repository": { "projects": {
1283 "nodes": [
1284 { "name": "Cleanup", "id": "CLEANUPID" },
1285 { "name": "Roadmap", "id": "ROADMAPID" }
1286 ],
1287 "pageInfo": { "hasNextPage": false }
1288 } } } }
1289 `))
1290 http.Register(
1291 httpmock.GraphQL(`query OrganizationProjectList\b`),
1292 httpmock.StringResponse(`
1293 { "data": { "organization": null },
1294 "errors": [{
1295 "type": "NOT_FOUND",
1296 "path": [ "organization" ],
1297 "message": "Could not resolve to an Organization with the login of 'OWNER'."
1298 }]
1299 }
1300 `))
1301 http.Register(
1302 httpmock.GraphQL(`query RepositoryProjectV2List\b`),
1303 httpmock.StringResponse(`
1304 { "data": { "repository": { "projectsV2": {
1305 "nodes": [],
1306 "pageInfo": { "hasNextPage": false }
1307 } } } }
1308 `))
1309 http.Register(

Callers

nothing calls this directly

Calls 10

VerifyMethod · 0.95
RegisterMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
GraphQLMutationFunction · 0.92
EqualMethod · 0.80
runCommandFunction · 0.70
ErrorfMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected