Skip to content

Commit d22e72a

Browse files
committed
Fix tests broken by incompatible merges
1 parent 44ae7ae commit d22e72a

File tree

2 files changed

+8
-29
lines changed

2 files changed

+8
-29
lines changed

pkg/cmd/issue/list/list_test.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -214,27 +214,6 @@ func TestIssueList_web(t *testing.T) {
214214
browser.Verify(t, "https://github.com/OWNER/REPO/issues?q=is%3Aissue+assignee%3Apeter+label%3Abug+label%3Adocs+author%3Ajohn+mentions%3Afrank+milestone%3Av1.1")
215215
}
216216

217-
func TestIssueList_Search_web(t *testing.T) {
218-
http := &httpmock.Registry{}
219-
defer http.Verify(t)
220-
221-
cs, cmdTeardown := run.Stub()
222-
defer cmdTeardown(t)
223-
224-
cs.Register(`https://github\.com`, 0, "", func(args []string) {
225-
url := strings.ReplaceAll(args[len(args)-1], "^", "")
226-
assert.Equal(t, "https://github.com/OWNER/REPO/issues?q=is%3Aissue+assignee%3Apeter+label%3Abug+label%3Adocs+author%3Ajohn+mentions%3Afrank+milestone%3Av1.1+transfer", url)
227-
})
228-
229-
output, err := runCommand(http, true, "--web -a peter -A john -l bug -l docs -L 10 -s all --mention frank --milestone v1.1 --search transfer")
230-
if err != nil {
231-
t.Errorf("error running command `issue list` with `--web` flag: %v", err)
232-
}
233-
234-
assert.Equal(t, "", output.String())
235-
assert.Equal(t, "Opening github.com/OWNER/REPO/issues in your browser.\n", output.Stderr())
236-
}
237-
238217
func Test_issueList(t *testing.T) {
239218
type args struct {
240219
repo ghrepo.Interface

pkg/cmd/pr/list/http_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func Test_listPullRequests(t *testing.T) {
1919
tests := []struct {
2020
name string
2121
args args
22-
httpStub func(*httpmock.Registry)
22+
httpStub func(*testing.T, *httpmock.Registry)
2323
wantErr bool
2424
}{
2525
{
@@ -31,7 +31,7 @@ func Test_listPullRequests(t *testing.T) {
3131
State: "open",
3232
},
3333
},
34-
httpStub: func(r *httpmock.Registry) {
34+
httpStub: func(t *testing.T, r *httpmock.Registry) {
3535
r.Register(
3636
httpmock.GraphQL(`query PullRequestList\b`),
3737
httpmock.GraphQLQuery(`{"data":{}}`, func(query string, vars map[string]interface{}) {
@@ -56,7 +56,7 @@ func Test_listPullRequests(t *testing.T) {
5656
State: "closed",
5757
},
5858
},
59-
httpStub: func(r *httpmock.Registry) {
59+
httpStub: func(t *testing.T, r *httpmock.Registry) {
6060
r.Register(
6161
httpmock.GraphQL(`query PullRequestList\b`),
6262
httpmock.GraphQLQuery(`{"data":{}}`, func(query string, vars map[string]interface{}) {
@@ -82,12 +82,12 @@ func Test_listPullRequests(t *testing.T) {
8282
Labels: []string{"hello", "one world"},
8383
},
8484
},
85-
httpStub: func(r *httpmock.Registry) {
85+
httpStub: func(t *testing.T, r *httpmock.Registry) {
8686
r.Register(
8787
httpmock.GraphQL(`query PullRequestSearch\b`),
8888
httpmock.GraphQLQuery(`{"data":{}}`, func(query string, vars map[string]interface{}) {
8989
want := map[string]interface{}{
90-
"q": `repo:OWNER/REPO is:pr is:open label:hello label:"one world" sort:created-desc`,
90+
"q": `repo:OWNER/REPO is:pr is:open label:hello label:"one world"`,
9191
"limit": float64(30),
9292
}
9393
if !reflect.DeepEqual(vars, want) {
@@ -106,7 +106,7 @@ func Test_listPullRequests(t *testing.T) {
106106
Author: "monalisa",
107107
},
108108
},
109-
httpStub: func(r *httpmock.Registry) {
109+
httpStub: func(t *testing.T, r *httpmock.Registry) {
110110
r.Register(
111111
httpmock.GraphQL(`query PullRequestSearch\b`),
112112
httpmock.GraphQLQuery(`{"data":{}}`, func(query string, vars map[string]interface{}) {
@@ -130,7 +130,7 @@ func Test_listPullRequests(t *testing.T) {
130130
Search: "one world in:title",
131131
},
132132
},
133-
httpStub: func(r *httpmock.Registry) {
133+
httpStub: func(t *testing.T, r *httpmock.Registry) {
134134
r.Register(
135135
httpmock.GraphQL(`query PullRequestSearch\b`),
136136
httpmock.GraphQLQuery(`{"data":{}}`, func(query string, vars map[string]interface{}) {
@@ -149,7 +149,7 @@ func Test_listPullRequests(t *testing.T) {
149149
t.Run(tt.name, func(t *testing.T) {
150150
reg := &httpmock.Registry{}
151151
if tt.httpStub != nil {
152-
tt.httpStub(reg)
152+
tt.httpStub(t, reg)
153153
}
154154
httpClient := &http.Client{Transport: reg}
155155

0 commit comments

Comments
 (0)