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

Function mockRepoMetadata

pkg/cmd/issue/edit/edit_test.go:1915–1992  ·  view source on GitHub ↗
(_ *testing.T, reg *httpmock.Registry)

Source from the content-addressed store, hash-verified

1913}
1914
1915func mockRepoMetadata(_ *testing.T, reg *httpmock.Registry) {
1916 reg.Register(
1917 httpmock.GraphQL(`query RepositoryLabelList\b`),
1918 httpmock.StringResponse(`
1919 { "data": { "repository": { "labels": {
1920 "nodes": [
1921 { "name": "feature", "id": "FEATUREID" },
1922 { "name": "TODO", "id": "TODOID" },
1923 { "name": "bug", "id": "BUGID" },
1924 { "name": "docs", "id": "DOCSID" }
1925 ],
1926 "pageInfo": { "hasNextPage": false }
1927 } } } }
1928 `))
1929 reg.Register(
1930 httpmock.GraphQL(`query RepositoryMilestoneList\b`),
1931 httpmock.StringResponse(`
1932 { "data": { "repository": { "milestones": {
1933 "nodes": [
1934 { "title": "GA", "id": "GAID" },
1935 { "title": "Big One.oh", "id": "BIGONEID" }
1936 ],
1937 "pageInfo": { "hasNextPage": false }
1938 } } } }
1939 `))
1940 reg.Register(
1941 httpmock.GraphQL(`query RepositoryProjectList\b`),
1942 httpmock.StringResponse(`
1943 { "data": { "repository": { "projects": {
1944 "nodes": [
1945 { "name": "Cleanup", "id": "CLEANUPID" },
1946 { "name": "Roadmap", "id": "ROADMAPID" }
1947 ],
1948 "pageInfo": { "hasNextPage": false }
1949 } } } }
1950 `))
1951 reg.Register(
1952 httpmock.GraphQL(`query OrganizationProjectList\b`),
1953 httpmock.StringResponse(`
1954 { "data": { "organization": { "projects": {
1955 "nodes": [
1956 { "name": "Triage", "id": "TRIAGEID" }
1957 ],
1958 "pageInfo": { "hasNextPage": false }
1959 } } } }
1960 `))
1961 reg.Register(
1962 httpmock.GraphQL(`query RepositoryProjectV2List\b`),
1963 httpmock.StringResponse(`
1964 { "data": { "repository": { "projectsV2": {
1965 "nodes": [
1966 { "title": "CleanupV2", "id": "CLEANUPV2ID" },
1967 { "title": "RoadmapV2", "id": "ROADMAPV2ID" }
1968 ],
1969 "pageInfo": { "hasNextPage": false }
1970 } } } }
1971 `))
1972 reg.Register(

Callers 1

Test_editRunFunction · 0.70

Calls 3

GraphQLFunction · 0.92
StringResponseFunction · 0.92
RegisterMethod · 0.45

Tested by

no test coverage detected