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

Function Test_createRun_GHES

pkg/cmd/pr/create/create_test.go:2122–2639  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2120}
2121
2122func Test_createRun_GHES(t *testing.T) {
2123 tests := []struct {
2124 name string
2125 setup func(*CreateOptions, *testing.T) func()
2126 cmdStubs func(*run.CommandStubber)
2127 promptStubs func(*prompter.PrompterMock)
2128 httpStubs func(*httpmock.Registry, *testing.T)
2129 expectedOutputs []string
2130 expectedOut string
2131 expectedErrOut string
2132 tty bool
2133 customBranchConfig bool
2134 }{
2135 {
2136 name: "dry-run-nontty-with-all-opts",
2137 tty: false,
2138 setup: func(opts *CreateOptions, t *testing.T) func() {
2139 opts.TitleProvided = true
2140 opts.BodyProvided = true
2141 opts.Title = "TITLE"
2142 opts.Body = "BODY"
2143 opts.BaseBranch = "trunk"
2144 opts.HeadBranch = "feature"
2145 opts.Assignees = []string{"monalisa"}
2146 opts.Labels = []string{"bug", "todo"}
2147 opts.Reviewers = []string{"hubot", "monalisa", "OWNER/core", "OWNER/robots"}
2148 opts.Milestone = "big one.oh"
2149 opts.DryRun = true
2150 return func() {}
2151 },
2152 httpStubs: func(reg *httpmock.Registry, t *testing.T) {
2153 reg.Register(
2154 httpmock.GraphQL(`query UserCurrent\b`),
2155 httpmock.StringResponse(`{"data": {"viewer": {"login": "OWNER"} } }`))
2156 reg.Register(
2157 httpmock.GraphQL(`query RepositoryAssignableUsers\b`),
2158 httpmock.StringResponse(`
2159 { "data": { "repository": { "assignableUsers": {
2160 "nodes": [
2161 { "login": "hubot", "id": "HUBOTID", "name": "" },
2162 { "login": "MonaLisa", "id": "MONAID", "name": "Mona Display Name" }
2163 ],
2164 "pageInfo": { "hasNextPage": false }
2165 } } } }
2166 `))
2167 reg.Register(
2168 httpmock.GraphQL(`query RepositoryLabelList\b`),
2169 httpmock.StringResponse(`
2170 { "data": { "repository": { "labels": {
2171 "nodes": [
2172 { "name": "TODO", "id": "TODOID" },
2173 { "name": "bug", "id": "BUGID" }
2174 ],
2175 "pageInfo": { "hasNextPage": false }
2176 } } } }
2177 `))
2178 reg.Register(
2179 httpmock.GraphQL(`query RepositoryMilestoneList\b`),

Callers

nothing calls this directly

Calls 15

RegisterMethod · 0.95
ExcludeMethod · 0.95
StubRepoInfoResponseMethod · 0.95
VerifyMethod · 0.95
StringMethod · 0.95
StderrMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
GraphQLMutationFunction · 0.92
IndexesForFunction · 0.92
IndexForFunction · 0.92
StubFunction · 0.92

Tested by

no test coverage detected