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

Function Test_createRun_GHES

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

Source from the content-addressed store, hash-verified

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