MCPcopy Create free account
hub / github.com/cli/cli / TestIssueCreate_metadata

Function TestIssueCreate_metadata

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

Source from the content-addressed store, hash-verified

1717}
1718
1719func TestIssueCreate_metadata(t *testing.T) {
1720 http := &httpmock.Registry{}
1721 defer http.Verify(t)
1722
1723 http.StubIssueRepoInfoResponse("OWNER", "REPO")
1724 http.Register(
1725 httpmock.GraphQL(`query RepositoryLabelList\b`),
1726 httpmock.StringResponse(`
1727 { "data": { "repository": { "labels": {
1728 "nodes": [
1729 { "name": "TODO", "id": "TODOID" },
1730 { "name": "bug", "id": "BUGID" }
1731 ],
1732 "pageInfo": { "hasNextPage": false }
1733 } } } }
1734 `))
1735 http.Register(
1736 httpmock.GraphQL(`query RepositoryMilestoneList\b`),
1737 httpmock.StringResponse(`
1738 { "data": { "repository": { "milestones": {
1739 "nodes": [
1740 { "title": "GA", "id": "GAID" },
1741 { "title": "Big One.oh", "id": "BIGONEID" }
1742 ],
1743 "pageInfo": { "hasNextPage": false }
1744 } } } }
1745 `))
1746 http.Register(
1747 httpmock.GraphQL(`query RepositoryProjectList\b`),
1748 httpmock.StringResponse(`
1749 { "data": { "repository": { "projects": {
1750 "nodes": [
1751 { "name": "Cleanup", "id": "CLEANUPID" },
1752 { "name": "Roadmap", "id": "ROADMAPID" }
1753 ],
1754 "pageInfo": { "hasNextPage": false }
1755 } } } }
1756 `))
1757 http.Register(
1758 httpmock.GraphQL(`query OrganizationProjectList\b`),
1759 httpmock.StringResponse(`
1760 { "data": { "organization": null },
1761 "errors": [{
1762 "type": "NOT_FOUND",
1763 "path": [ "organization" ],
1764 "message": "Could not resolve to an Organization with the login of 'OWNER'."
1765 }]
1766 }
1767 `))
1768 http.Register(
1769 httpmock.GraphQL(`query RepositoryProjectV2List\b`),
1770 httpmock.StringResponse(`
1771 { "data": { "repository": { "projectsV2": {
1772 "nodes": [],
1773 "pageInfo": { "hasNextPage": false }
1774 } } } }
1775 `))
1776 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.65

Tested by

no test coverage detected