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

Function TestIssueCreate_projectsV2

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

Source from the content-addressed store, hash-verified

1984}
1985
1986func TestIssueCreate_projectsV2(t *testing.T) {
1987 http := &httpmock.Registry{}
1988 defer http.Verify(t)
1989
1990 http.StubIssueRepoInfoResponse("OWNER", "REPO")
1991 http.Register(
1992 httpmock.GraphQL(`query RepositoryProjectList\b`),
1993 httpmock.StringResponse(`
1994 { "data": { "repository": { "projects": {
1995 "nodes": [],
1996 "pageInfo": { "hasNextPage": false }
1997 } } } }
1998 `))
1999 http.Register(
2000 httpmock.GraphQL(`query OrganizationProjectList\b`),
2001 httpmock.StringResponse(`
2002 { "data": { "organization": { "projects": {
2003 "nodes": [],
2004 "pageInfo": { "hasNextPage": false }
2005 } } } }
2006 `))
2007 http.Register(
2008 httpmock.GraphQL(`query RepositoryProjectV2List\b`),
2009 httpmock.StringResponse(`
2010 { "data": { "repository": { "projectsV2": {
2011 "nodes": [
2012 { "title": "CleanupV2", "id": "CLEANUPV2ID" },
2013 { "title": "RoadmapV2", "id": "ROADMAPV2ID" }
2014 ],
2015 "pageInfo": { "hasNextPage": false }
2016 } } } }
2017 `))
2018 http.Register(
2019 httpmock.GraphQL(`query OrganizationProjectV2List\b`),
2020 httpmock.StringResponse(`
2021 { "data": { "organization": { "projectsV2": {
2022 "nodes": [
2023 { "title": "TriageV2", "id": "TRIAGEV2ID" }
2024 ],
2025 "pageInfo": { "hasNextPage": false }
2026 } } } }
2027 `))
2028 http.Register(
2029 httpmock.GraphQL(`query UserProjectV2List\b`),
2030 httpmock.StringResponse(`
2031 { "data": { "viewer": { "projectsV2": {
2032 "nodes": [
2033 { "title": "MonalisaV2", "id": "MONALISAV2ID" }
2034 ],
2035 "pageInfo": { "hasNextPage": false }
2036 } } } }
2037 `))
2038 http.Register(
2039 httpmock.GraphQL(`mutation IssueCreate\b`),
2040 httpmock.GraphQLMutation(`
2041 { "data": { "createIssue": { "issue": {
2042 "id": "Issue#1",
2043 "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