MCPcopy
hub / github.com/cli/cli / Test_createRun_GHES

Function Test_createRun_GHES

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

Source from the content-addressed store, hash-verified

1661}
1662
1663func Test_createRun_GHES(t *testing.T) {
1664 tests := []struct {
1665 name string
1666 setup func(*CreateOptions, *testing.T) func()
1667 cmdStubs func(*run.CommandStubber)
1668 promptStubs func(*prompter.PrompterMock)
1669 httpStubs func(*httpmock.Registry, *testing.T)
1670 expectedOutputs []string
1671 expectedOut string
1672 expectedErrOut string
1673 tty bool
1674 customBranchConfig bool
1675 }{
1676 {
1677 name: "dry-run-nontty-with-all-opts",
1678 tty: false,
1679 setup: func(opts *CreateOptions, t *testing.T) func() {
1680 opts.TitleProvided = true
1681 opts.BodyProvided = true
1682 opts.Title = "TITLE"
1683 opts.Body = "BODY"
1684 opts.BaseBranch = "trunk"
1685 opts.HeadBranch = "feature"
1686 opts.Assignees = []string{"monalisa"}
1687 opts.Labels = []string{"bug", "todo"}
1688 opts.Reviewers = []string{"hubot", "monalisa", "OWNER/core", "OWNER/robots"}
1689 opts.Milestone = "big one.oh"
1690 opts.DryRun = true
1691 return func() {}
1692 },
1693 httpStubs: func(reg *httpmock.Registry, t *testing.T) {
1694 reg.Register(
1695 httpmock.GraphQL(`query UserCurrent\b`),
1696 httpmock.StringResponse(`{"data": {"viewer": {"login": "OWNER"} } }`))
1697 reg.Register(
1698 httpmock.GraphQL(`query RepositoryAssignableUsers\b`),
1699 httpmock.StringResponse(`
1700 { "data": { "repository": { "assignableUsers": {
1701 "nodes": [
1702 { "login": "hubot", "id": "HUBOTID", "name": "" },
1703 { "login": "MonaLisa", "id": "MONAID", "name": "Mona Display Name" }
1704 ],
1705 "pageInfo": { "hasNextPage": false }
1706 } } } }
1707 `))
1708 reg.Register(
1709 httpmock.GraphQL(`query RepositoryLabelList\b`),
1710 httpmock.StringResponse(`
1711 { "data": { "repository": { "labels": {
1712 "nodes": [
1713 { "name": "TODO", "id": "TODOID" },
1714 { "name": "bug", "id": "BUGID" }
1715 ],
1716 "pageInfo": { "hasNextPage": false }
1717 } } } }
1718 `))
1719 reg.Register(
1720 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