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

Function TestIssueCreate_projectsV2

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

Source from the content-addressed store, hash-verified

1940}
1941
1942func TestIssueCreate_projectsV2(t *testing.T) {
1943 http := &httpmock.Registry{}
1944 defer http.Verify(t)
1945
1946 http.StubIssueRepoInfoResponse("OWNER", "REPO")
1947 http.Register(
1948 httpmock.GraphQL(`query RepositoryProjectList\b`),
1949 httpmock.StringResponse(`
1950 { "data": { "repository": { "projects": {
1951 "nodes": [],
1952 "pageInfo": { "hasNextPage": false }
1953 } } } }
1954 `))
1955 http.Register(
1956 httpmock.GraphQL(`query OrganizationProjectList\b`),
1957 httpmock.StringResponse(`
1958 { "data": { "organization": { "projects": {
1959 "nodes": [],
1960 "pageInfo": { "hasNextPage": false }
1961 } } } }
1962 `))
1963 http.Register(
1964 httpmock.GraphQL(`query RepositoryProjectV2List\b`),
1965 httpmock.StringResponse(`
1966 { "data": { "repository": { "projectsV2": {
1967 "nodes": [
1968 { "title": "CleanupV2", "id": "CLEANUPV2ID" },
1969 { "title": "RoadmapV2", "id": "ROADMAPV2ID" }
1970 ],
1971 "pageInfo": { "hasNextPage": false }
1972 } } } }
1973 `))
1974 http.Register(
1975 httpmock.GraphQL(`query OrganizationProjectV2List\b`),
1976 httpmock.StringResponse(`
1977 { "data": { "organization": { "projectsV2": {
1978 "nodes": [
1979 { "title": "TriageV2", "id": "TRIAGEV2ID" }
1980 ],
1981 "pageInfo": { "hasNextPage": false }
1982 } } } }
1983 `))
1984 http.Register(
1985 httpmock.GraphQL(`query UserProjectV2List\b`),
1986 httpmock.StringResponse(`
1987 { "data": { "viewer": { "projectsV2": {
1988 "nodes": [
1989 { "title": "MonalisaV2", "id": "MONALISAV2ID" }
1990 ],
1991 "pageInfo": { "hasNextPage": false }
1992 } } } }
1993 `))
1994 http.Register(
1995 httpmock.GraphQL(`mutation IssueCreate\b`),
1996 httpmock.GraphQLMutation(`
1997 { "data": { "createIssue": { "issue": {
1998 "id": "Issue#1",
1999 "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.65

Tested by

no test coverage detected