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

Function TestIssueCreate_metadata

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

Source from the content-addressed store, hash-verified

1761}
1762
1763func TestIssueCreate_metadata(t *testing.T) {
1764 http := &httpmock.Registry{}
1765 defer http.Verify(t)
1766
1767 http.StubIssueRepoInfoResponse("OWNER", "REPO")
1768 http.Register(
1769 httpmock.GraphQL(`query RepositoryLabelList\b`),
1770 httpmock.StringResponse(`
1771 { "data": { "repository": { "labels": {
1772 "nodes": [
1773 { "name": "TODO", "id": "TODOID" },
1774 { "name": "bug", "id": "BUGID" }
1775 ],
1776 "pageInfo": { "hasNextPage": false }
1777 } } } }
1778 `))
1779 http.Register(
1780 httpmock.GraphQL(`query RepositoryMilestoneList\b`),
1781 httpmock.StringResponse(`
1782 { "data": { "repository": { "milestones": {
1783 "nodes": [
1784 { "title": "GA", "id": "GAID" },
1785 { "title": "Big One.oh", "id": "BIGONEID" }
1786 ],
1787 "pageInfo": { "hasNextPage": false }
1788 } } } }
1789 `))
1790 http.Register(
1791 httpmock.GraphQL(`query RepositoryProjectList\b`),
1792 httpmock.StringResponse(`
1793 { "data": { "repository": { "projects": {
1794 "nodes": [
1795 { "name": "Cleanup", "id": "CLEANUPID" },
1796 { "name": "Roadmap", "id": "ROADMAPID" }
1797 ],
1798 "pageInfo": { "hasNextPage": false }
1799 } } } }
1800 `))
1801 http.Register(
1802 httpmock.GraphQL(`query OrganizationProjectList\b`),
1803 httpmock.StringResponse(`
1804 { "data": { "organization": null },
1805 "errors": [{
1806 "type": "NOT_FOUND",
1807 "path": [ "organization" ],
1808 "message": "Could not resolve to an Organization with the login of 'OWNER'."
1809 }]
1810 }
1811 `))
1812 http.Register(
1813 httpmock.GraphQL(`query RepositoryProjectV2List\b`),
1814 httpmock.StringResponse(`
1815 { "data": { "repository": { "projectsV2": {
1816 "nodes": [],
1817 "pageInfo": { "hasNextPage": false }
1818 } } } }
1819 `))
1820 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