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

Function TestIssueCreate_metadata

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

Source from the content-addressed store, hash-verified

1744}
1745
1746func TestIssueCreate_metadata(t *testing.T) {
1747 http := &httpmock.Registry{}
1748 defer http.Verify(t)
1749
1750 http.StubIssueRepoInfoResponse("OWNER", "REPO")
1751 http.Register(
1752 httpmock.GraphQL(`query RepositoryLabelList\b`),
1753 httpmock.StringResponse(`
1754 { "data": { "repository": { "labels": {
1755 "nodes": [
1756 { "name": "TODO", "id": "TODOID" },
1757 { "name": "bug", "id": "BUGID" }
1758 ],
1759 "pageInfo": { "hasNextPage": false }
1760 } } } }
1761 `))
1762 http.Register(
1763 httpmock.GraphQL(`query RepositoryMilestoneList\b`),
1764 httpmock.StringResponse(`
1765 { "data": { "repository": { "milestones": {
1766 "nodes": [
1767 { "title": "GA", "id": "GAID" },
1768 { "title": "Big One.oh", "id": "BIGONEID" }
1769 ],
1770 "pageInfo": { "hasNextPage": false }
1771 } } } }
1772 `))
1773 http.Register(
1774 httpmock.GraphQL(`query RepositoryProjectList\b`),
1775 httpmock.StringResponse(`
1776 { "data": { "repository": { "projects": {
1777 "nodes": [
1778 { "name": "Cleanup", "id": "CLEANUPID" },
1779 { "name": "Roadmap", "id": "ROADMAPID" }
1780 ],
1781 "pageInfo": { "hasNextPage": false }
1782 } } } }
1783 `))
1784 http.Register(
1785 httpmock.GraphQL(`query OrganizationProjectList\b`),
1786 httpmock.StringResponse(`
1787 { "data": { "organization": null },
1788 "errors": [{
1789 "type": "NOT_FOUND",
1790 "path": [ "organization" ],
1791 "message": "Could not resolve to an Organization with the login of 'OWNER'."
1792 }]
1793 }
1794 `))
1795 http.Register(
1796 httpmock.GraphQL(`query RepositoryProjectV2List\b`),
1797 httpmock.StringResponse(`
1798 { "data": { "repository": { "projectsV2": {
1799 "nodes": [],
1800 "pageInfo": { "hasNextPage": false }
1801 } } } }
1802 `))
1803 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