@@ -357,6 +357,7 @@ func Test_editRun(t *testing.T) {
357357 mockRepoMetadata (t , reg , false )
358358 mockPullRequestUpdate (t , reg )
359359 mockPullRequestReviewersUpdate (t , reg )
360+ mockPullRequestUpdateLabels (t , reg )
360361 },
361362 stdout : "https://github.com/OWNER/REPO/pull/123\n " ,
362363 },
@@ -387,7 +388,7 @@ func Test_editRun(t *testing.T) {
387388 Edited : true ,
388389 },
389390 Labels : shared.EditableSlice {
390- Value : []string {"feature" , "TODO" , "bug" },
391+ Add : []string {"feature" , "TODO" , "bug" },
391392 Remove : []string {"docs" },
392393 Edited : true ,
393394 },
@@ -406,6 +407,7 @@ func Test_editRun(t *testing.T) {
406407 httpStubs : func (t * testing.T , reg * httpmock.Registry ) {
407408 mockRepoMetadata (t , reg , true )
408409 mockPullRequestUpdate (t , reg )
410+ mockPullRequestUpdateLabels (t , reg )
409411 },
410412 stdout : "https://github.com/OWNER/REPO/pull/123\n " ,
411413 },
@@ -490,7 +492,8 @@ func mockRepoMetadata(_ *testing.T, reg *httpmock.Registry, skipReviewers bool)
490492 "nodes": [
491493 { "name": "feature", "id": "FEATUREID" },
492494 { "name": "TODO", "id": "TODOID" },
493- { "name": "bug", "id": "BUGID" }
495+ { "name": "bug", "id": "BUGID" },
496+ { "name": "docs", "id": "DOCSID" }
494497 ],
495498 "pageInfo": { "hasNextPage": false }
496499 } } } }
@@ -554,6 +557,21 @@ func mockPullRequestReviewersUpdate(t *testing.T, reg *httpmock.Registry) {
554557 httpmock .StringResponse (`{}` ))
555558}
556559
560+ func mockPullRequestUpdateLabels (t * testing.T , reg * httpmock.Registry ) {
561+ reg .Register (
562+ httpmock .GraphQL (`mutation LabelAdd\b` ),
563+ httpmock .GraphQLMutation (`
564+ { "data": { "addLabelsToLabelable": { "__typename": "" } } }` ,
565+ func (inputs map [string ]interface {}) {}),
566+ )
567+ reg .Register (
568+ httpmock .GraphQL (`mutation LabelRemove\b` ),
569+ httpmock .GraphQLMutation (`
570+ { "data": { "removeLabelsFromLabelable": { "__typename": "" } } }` ,
571+ func (inputs map [string ]interface {}) {}),
572+ )
573+ }
574+
557575type testFetcher struct {}
558576type testSurveyor struct {
559577 skipReviewers bool
0 commit comments