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

Function TestIssueCreate_projectsV2

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

Source from the content-addressed store, hash-verified

1967}
1968
1969func TestIssueCreate_projectsV2(t *testing.T) {
1970 http := &httpmock.Registry{}
1971 defer http.Verify(t)
1972
1973 http.StubIssueRepoInfoResponse("OWNER", "REPO")
1974 http.Register(
1975 httpmock.GraphQL(`query RepositoryProjectList\b`),
1976 httpmock.StringResponse(`
1977 { "data": { "repository": { "projects": {
1978 "nodes": [],
1979 "pageInfo": { "hasNextPage": false }
1980 } } } }
1981 `))
1982 http.Register(
1983 httpmock.GraphQL(`query OrganizationProjectList\b`),
1984 httpmock.StringResponse(`
1985 { "data": { "organization": { "projects": {
1986 "nodes": [],
1987 "pageInfo": { "hasNextPage": false }
1988 } } } }
1989 `))
1990 http.Register(
1991 httpmock.GraphQL(`query RepositoryProjectV2List\b`),
1992 httpmock.StringResponse(`
1993 { "data": { "repository": { "projectsV2": {
1994 "nodes": [
1995 { "title": "CleanupV2", "id": "CLEANUPV2ID" },
1996 { "title": "RoadmapV2", "id": "ROADMAPV2ID" }
1997 ],
1998 "pageInfo": { "hasNextPage": false }
1999 } } } }
2000 `))
2001 http.Register(
2002 httpmock.GraphQL(`query OrganizationProjectV2List\b`),
2003 httpmock.StringResponse(`
2004 { "data": { "organization": { "projectsV2": {
2005 "nodes": [
2006 { "title": "TriageV2", "id": "TRIAGEV2ID" }
2007 ],
2008 "pageInfo": { "hasNextPage": false }
2009 } } } }
2010 `))
2011 http.Register(
2012 httpmock.GraphQL(`query UserProjectV2List\b`),
2013 httpmock.StringResponse(`
2014 { "data": { "viewer": { "projectsV2": {
2015 "nodes": [
2016 { "title": "MonalisaV2", "id": "MONALISAV2ID" }
2017 ],
2018 "pageInfo": { "hasNextPage": false }
2019 } } } }
2020 `))
2021 http.Register(
2022 httpmock.GraphQL(`mutation IssueCreate\b`),
2023 httpmock.GraphQLMutation(`
2024 { "data": { "createIssue": { "issue": {
2025 "id": "Issue#1",
2026 "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