@@ -15,6 +15,10 @@ func TestPRCreate(t *testing.T) {
1515 initBlankContext ("OWNER/REPO" , "feature" )
1616 http := initFakeHTTP ()
1717 http .StubRepoResponse ("OWNER" , "REPO" )
18+ http .StubResponse (200 , bytes .NewBufferString (`
19+ { "data": { "repository": { "forks": { "nodes": [
20+ ] } } } }
21+ ` ))
1822 http .StubResponse (200 , bytes .NewBufferString (`
1923 { "data": { "repository": { "pullRequests": { "nodes" : [
2024 ] } } } }
@@ -37,7 +41,7 @@ func TestPRCreate(t *testing.T) {
3741 output , err := RunCommand (prCreateCmd , `pr create -t "my title" -b "my body"` )
3842 eq (t , err , nil )
3943
40- bodyBytes , _ := ioutil .ReadAll (http .Requests [2 ].Body )
44+ bodyBytes , _ := ioutil .ReadAll (http .Requests [3 ].Body )
4145 reqBody := struct {
4246 Variables struct {
4347 Input struct {
@@ -64,6 +68,10 @@ func TestPRCreate_alreadyExists(t *testing.T) {
6468 initBlankContext ("OWNER/REPO" , "feature" )
6569 http := initFakeHTTP ()
6670 http .StubRepoResponse ("OWNER" , "REPO" )
71+ http .StubResponse (200 , bytes .NewBufferString (`
72+ { "data": { "repository": { "forks": { "nodes": [
73+ ] } } } }
74+ ` ))
6775 http .StubResponse (200 , bytes .NewBufferString (`
6876 { "data": { "repository": { "pullRequests": { "nodes": [
6977 { "url": "https://github.com/OWNER/REPO/pull/123",
@@ -93,6 +101,10 @@ func TestPRCreate_alreadyExistsDifferentBase(t *testing.T) {
93101 initBlankContext ("OWNER/REPO" , "feature" )
94102 http := initFakeHTTP ()
95103 http .StubRepoResponse ("OWNER" , "REPO" )
104+ http .StubResponse (200 , bytes .NewBufferString (`
105+ { "data": { "repository": { "forks": { "nodes": [
106+ ] } } } }
107+ ` ))
96108 http .StubResponse (200 , bytes .NewBufferString (`
97109 { "data": { "repository": { "pullRequests": { "nodes": [
98110 { "url": "https://github.com/OWNER/REPO/pull/123",
@@ -121,6 +133,10 @@ func TestPRCreate_web(t *testing.T) {
121133 initBlankContext ("OWNER/REPO" , "feature" )
122134 http := initFakeHTTP ()
123135 http .StubRepoResponse ("OWNER" , "REPO" )
136+ http .StubResponse (200 , bytes .NewBufferString (`
137+ { "data": { "repository": { "forks": { "nodes": [
138+ ] } } } }
139+ ` ))
124140
125141 cs , cmdTeardown := initCmdStubber ()
126142 defer cmdTeardown ()
@@ -149,6 +165,10 @@ func TestPRCreate_ReportsUncommittedChanges(t *testing.T) {
149165 http := initFakeHTTP ()
150166
151167 http .StubRepoResponse ("OWNER" , "REPO" )
168+ http .StubResponse (200 , bytes .NewBufferString (`
169+ { "data": { "repository": { "forks": { "nodes": [
170+ ] } } } }
171+ ` ))
152172 http .StubResponse (200 , bytes .NewBufferString (`
153173 { "data": { "repository": { "pullRequests": { "nodes" : [
154174 ] } } } }
@@ -272,6 +292,10 @@ func TestPRCreate_survey_defaults_multicommit(t *testing.T) {
272292 initBlankContext ("OWNER/REPO" , "cool_bug-fixes" )
273293 http := initFakeHTTP ()
274294 http .StubRepoResponse ("OWNER" , "REPO" )
295+ http .StubResponse (200 , bytes .NewBufferString (`
296+ { "data": { "repository": { "forks": { "nodes": [
297+ ] } } } }
298+ ` ))
275299 http .StubResponse (200 , bytes .NewBufferString (`
276300 { "data": { "repository": { "pullRequests": { "nodes" : [
277301 ] } } } }
@@ -315,7 +339,7 @@ func TestPRCreate_survey_defaults_multicommit(t *testing.T) {
315339 output , err := RunCommand (prCreateCmd , `pr create` )
316340 eq (t , err , nil )
317341
318- bodyBytes , _ := ioutil .ReadAll (http .Requests [2 ].Body )
342+ bodyBytes , _ := ioutil .ReadAll (http .Requests [3 ].Body )
319343 reqBody := struct {
320344 Variables struct {
321345 Input struct {
@@ -344,6 +368,10 @@ func TestPRCreate_survey_defaults_monocommit(t *testing.T) {
344368 initBlankContext ("OWNER/REPO" , "feature" )
345369 http := initFakeHTTP ()
346370 http .StubRepoResponse ("OWNER" , "REPO" )
371+ http .StubResponse (200 , bytes .NewBufferString (`
372+ { "data": { "repository": { "forks": { "nodes": [
373+ ] } } } }
374+ ` ))
347375 http .StubResponse (200 , bytes .NewBufferString (`
348376 { "data": { "repository": { "pullRequests": { "nodes" : [
349377 ] } } } }
@@ -388,7 +416,7 @@ func TestPRCreate_survey_defaults_monocommit(t *testing.T) {
388416 output , err := RunCommand (prCreateCmd , `pr create` )
389417 eq (t , err , nil )
390418
391- bodyBytes , _ := ioutil .ReadAll (http .Requests [2 ].Body )
419+ bodyBytes , _ := ioutil .ReadAll (http .Requests [3 ].Body )
392420 reqBody := struct {
393421 Variables struct {
394422 Input struct {
@@ -417,6 +445,10 @@ func TestPRCreate_survey_autofill(t *testing.T) {
417445 initBlankContext ("OWNER/REPO" , "feature" )
418446 http := initFakeHTTP ()
419447 http .StubRepoResponse ("OWNER" , "REPO" )
448+ http .StubResponse (200 , bytes .NewBufferString (`
449+ { "data": { "repository": { "forks": { "nodes": [
450+ ] } } } }
451+ ` ))
420452 http .StubResponse (200 , bytes .NewBufferString (`
421453 { "data": { "repository": { "pullRequests": { "nodes" : [
422454 ] } } } }
@@ -442,7 +474,7 @@ func TestPRCreate_survey_autofill(t *testing.T) {
442474 output , err := RunCommand (prCreateCmd , `pr create -f` )
443475 eq (t , err , nil )
444476
445- bodyBytes , _ := ioutil .ReadAll (http .Requests [2 ].Body )
477+ bodyBytes , _ := ioutil .ReadAll (http .Requests [3 ].Body )
446478 reqBody := struct {
447479 Variables struct {
448480 Input struct {
@@ -507,6 +539,10 @@ func TestPRCreate_defaults_error_interactive(t *testing.T) {
507539 initBlankContext ("OWNER/REPO" , "feature" )
508540 http := initFakeHTTP ()
509541 http .StubRepoResponse ("OWNER" , "REPO" )
542+ http .StubResponse (200 , bytes .NewBufferString (`
543+ { "data": { "repository": { "forks": { "nodes": [
544+ ] } } } }
545+ ` ))
510546 http .StubResponse (200 , bytes .NewBufferString (`
511547 { "data": { "createPullRequest": { "pullRequest": {
512548 "URL": "https://github.com/OWNER/REPO/pull/12"
0 commit comments