@@ -314,7 +314,7 @@ func TestIssuesService_Edit(t *testing.T) {
314314t .Parallel ()
315315client , mux , _ := setup (t )
316316
317- input := & IssueRequest {Title : Ptr ("t" )}
317+ input := & IssueRequest {Title : Ptr ("t" ), Type : Ptr ( "bug" ) }
318318
319319mux .HandleFunc ("/repos/o/r/issues/1" , func (w http.ResponseWriter , r * http.Request ) {
320320v := new (IssueRequest )
@@ -325,7 +325,7 @@ func TestIssuesService_Edit(t *testing.T) {
325325t .Errorf ("Request body = %+v, want %+v" , v , input )
326326}
327327
328- fmt .Fprint (w , `{"number":1}` )
328+ fmt .Fprint (w , `{"number":1, "type": {"name": "bug"} }` )
329329})
330330
331331ctx := context .Background ()
@@ -334,7 +334,7 @@ func TestIssuesService_Edit(t *testing.T) {
334334t .Errorf ("Issues.Edit returned error: %v" , err )
335335}
336336
337- want := & Issue {Number : Ptr (1 )}
337+ want := & Issue {Number : Ptr (1 ), Type : & IssueType { Name : Ptr ( "bug" )} }
338338if ! cmp .Equal (issue , want ) {
339339t .Errorf ("Issues.Edit returned %+v, want %+v" , issue , want )
340340}
@@ -529,6 +529,7 @@ func TestIssueRequest_Marshal(t *testing.T) {
529529State : Ptr ("url" ),
530530Milestone : Ptr (1 ),
531531Assignees : & []string {"a" },
532+ Type : Ptr ("issue_type" ),
532533}
533534
534535want := `{
@@ -542,7 +543,8 @@ func TestIssueRequest_Marshal(t *testing.T) {
542543"milestone": 1,
543544"assignees": [
544545"a"
545- ]
546+ ],
547+ "type": "issue_type"
546548}`
547549
548550testJSONMarshal (t , u , want )
@@ -582,6 +584,7 @@ func TestIssue_Marshal(t *testing.T) {
582584NodeID : Ptr ("nid" ),
583585TextMatches : []* TextMatch {{ObjectURL : Ptr ("ourl" )}},
584586ActiveLockReason : Ptr ("alr" ),
587+ Type : & IssueType {Name : Ptr ("bug" )},
585588}
586589
587590want := `{
@@ -639,7 +642,10 @@ func TestIssue_Marshal(t *testing.T) {
639642"object_url": "ourl"
640643}
641644],
642- "active_lock_reason": "alr"
645+ "active_lock_reason": "alr",
646+ "type": {
647+ "name": "bug"
648+ }
643649}`
644650
645651testJSONMarshal (t , u , want )
0 commit comments