MCPcopy Index your code
hub / github.com/cli/cli / TestIssueCreate_projectsV2

Function TestIssueCreate_projectsV2

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

Source from the content-addressed store, hash-verified

1473}
1474
1475func TestIssueCreate_projectsV2(t *testing.T) {
1476 http := &httpmock.Registry{}
1477 defer http.Verify(t)
1478
1479 http.StubIssueRepoInfoResponse("OWNER", "REPO")
1480 http.Register(
1481 httpmock.GraphQL(`query RepositoryProjectList\b`),
1482 httpmock.StringResponse(`
1483 { "data": { "repository": { "projects": {
1484 "nodes": [],
1485 "pageInfo": { "hasNextPage": false }
1486 } } } }
1487 `))
1488 http.Register(
1489 httpmock.GraphQL(`query OrganizationProjectList\b`),
1490 httpmock.StringResponse(`
1491 { "data": { "organization": { "projects": {
1492 "nodes": [],
1493 "pageInfo": { "hasNextPage": false }
1494 } } } }
1495 `))
1496 http.Register(
1497 httpmock.GraphQL(`query RepositoryProjectV2List\b`),
1498 httpmock.StringResponse(`
1499 { "data": { "repository": { "projectsV2": {
1500 "nodes": [
1501 { "title": "CleanupV2", "id": "CLEANUPV2ID" },
1502 { "title": "RoadmapV2", "id": "ROADMAPV2ID" }
1503 ],
1504 "pageInfo": { "hasNextPage": false }
1505 } } } }
1506 `))
1507 http.Register(
1508 httpmock.GraphQL(`query OrganizationProjectV2List\b`),
1509 httpmock.StringResponse(`
1510 { "data": { "organization": { "projectsV2": {
1511 "nodes": [
1512 { "title": "TriageV2", "id": "TRIAGEV2ID" }
1513 ],
1514 "pageInfo": { "hasNextPage": false }
1515 } } } }
1516 `))
1517 http.Register(
1518 httpmock.GraphQL(`query UserProjectV2List\b`),
1519 httpmock.StringResponse(`
1520 { "data": { "viewer": { "projectsV2": {
1521 "nodes": [
1522 { "title": "MonalisaV2", "id": "MONALISAV2ID" }
1523 ],
1524 "pageInfo": { "hasNextPage": false }
1525 } } } }
1526 `))
1527 http.Register(
1528 httpmock.GraphQL(`mutation IssueCreate\b`),
1529 httpmock.GraphQLMutation(`
1530 { "data": { "createIssue": { "issue": {
1531 "id": "Issue#1",
1532 "URL": "https://github.com/OWNER/REPO/issues/12"

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected