"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/cmd/issue/create/create_test.go" between
gh-cli-1.11.0.tar.gz and gh-cli-1.12.0.tar.gz

About: GitHub CLI is GitHub’s official command line tool.

create_test.go  (gh-cli-1.11.0):create_test.go  (gh-cli-1.12.0)
skipping to change at line 117 skipping to change at line 117
var opts *CreateOptions var opts *CreateOptions
cmd := NewCmdCreate(f, func(o *CreateOptions) error { cmd := NewCmdCreate(f, func(o *CreateOptions) error {
opts = o opts = o
return nil return nil
}) })
args, err := shlex.Split(tt.cli) args, err := shlex.Split(tt.cli)
require.NoError(t, err) require.NoError(t, err)
cmd.SetArgs(args) cmd.SetArgs(args)
cmd.SetOut(ioutil.Discard)
cmd.SetErr(ioutil.Discard)
_, err = cmd.ExecuteC() _, err = cmd.ExecuteC()
if tt.wantsErr { if tt.wantsErr {
assert.Error(t, err) assert.Error(t, err)
return return
} else { } else {
require.NoError(t, err) require.NoError(t, err)
} }
assert.Equal(t, "", stdout.String()) assert.Equal(t, "", stdout.String())
assert.Equal(t, "", stderr.String()) assert.Equal(t, "", stderr.String())
skipping to change at line 171 skipping to change at line 173
}, },
wantsBrowse: "https://github.com/OWNER/REPO/issues/new?bo dy=hello+cli&title=myissue", wantsBrowse: "https://github.com/OWNER/REPO/issues/new?bo dy=hello+cli&title=myissue",
wantsStderr: "Opening github.com/OWNER/REPO/issues/new in your browser.\n", wantsStderr: "Opening github.com/OWNER/REPO/issues/new in your browser.\n",
}, },
{ {
name: "assignee", name: "assignee",
opts: CreateOptions{ opts: CreateOptions{
WebMode: true, WebMode: true,
Assignees: []string{"monalisa"}, Assignees: []string{"monalisa"},
}, },
wantsBrowse: "https://github.com/OWNER/REPO/issues/new?as signees=monalisa", wantsBrowse: "https://github.com/OWNER/REPO/issues/new?as signees=monalisa&body=",
wantsStderr: "Opening github.com/OWNER/REPO/issues/new in your browser.\n", wantsStderr: "Opening github.com/OWNER/REPO/issues/new in your browser.\n",
}, },
{ {
name: "@me", name: "@me",
opts: CreateOptions{ opts: CreateOptions{
WebMode: true, WebMode: true,
Assignees: []string{"@me"}, Assignees: []string{"@me"},
}, },
httpStubs: func(r *httpmock.Registry) { httpStubs: func(r *httpmock.Registry) {
r.Register( r.Register(
httpmock.GraphQL(`query UserCurrent\b`), httpmock.GraphQL(`query UserCurrent\b`),
httpmock.StringResponse(` httpmock.StringResponse(`
{ "data": { { "data": {
"viewer": { "login": "MonaLisa" } "viewer": { "login": "MonaLisa" }
} }`)) } }`))
}, },
wantsBrowse: "https://github.com/OWNER/REPO/issues/new?as signees=MonaLisa", wantsBrowse: "https://github.com/OWNER/REPO/issues/new?as signees=MonaLisa&body=",
wantsStderr: "Opening github.com/OWNER/REPO/issues/new in your browser.\n", wantsStderr: "Opening github.com/OWNER/REPO/issues/new in your browser.\n",
}, },
{ {
name: "project", name: "project",
opts: CreateOptions{ opts: CreateOptions{
WebMode: true, WebMode: true,
Projects: []string{"cleanup"}, Projects: []string{"cleanup"},
}, },
httpStubs: func(r *httpmock.Registry) { httpStubs: func(r *httpmock.Registry) {
r.Register( r.Register(
skipping to change at line 217 skipping to change at line 219
r.Register( r.Register(
httpmock.GraphQL(`query OrganizationProje ctList\b`), httpmock.GraphQL(`query OrganizationProje ctList\b`),
httpmock.StringResponse(` httpmock.StringResponse(`
{ "data": { "organization": { "projects": { { "data": { "organization": { "projects": {
"nodes": [ "nodes": [
{ "name": "Triage", "id": "TRIAGEID", "resourcePath": "/orgs/ORG/projects/1" } { "name": "Triage", "id": "TRIAGEID", "resourcePath": "/orgs/ORG/projects/1" }
], ],
"pageInfo": { "hasNextPage": fals e } "pageInfo": { "hasNextPage": fals e }
} } } }`)) } } } }`))
}, },
wantsBrowse: "https://github.com/OWNER/REPO/issues/new?pr ojects=OWNER%2FREPO%2F1", wantsBrowse: "https://github.com/OWNER/REPO/issues/new?bo dy=&projects=OWNER%2FREPO%2F1",
wantsStderr: "Opening github.com/OWNER/REPO/issues/new in your browser.\n", wantsStderr: "Opening github.com/OWNER/REPO/issues/new in your browser.\n",
}, },
{ {
name: "has templates", name: "has templates",
opts: CreateOptions{ opts: CreateOptions{
WebMode: true, WebMode: true,
}, },
httpStubs: func(r *httpmock.Registry) { httpStubs: func(r *httpmock.Registry) {
r.Register( r.Register(
httpmock.GraphQL(`query IssueTemplates\b` ), httpmock.GraphQL(`query IssueTemplates\b` ),
 End of changes. 4 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)