@@ -314,7 +314,7 @@ func TestIssuesService_Edit(t *testing.T) {
314314 t .Parallel ()
315315 client , mux , _ := setup (t )
316316
317- input := & IssueRequest {Title : Ptr ("t" )}
317+ input := & IssueRequest {Title : Ptr ("t" ), Type : Ptr ( "bug" ) }
318318
319319 mux .HandleFunc ("/repos/o/r/issues/1" , func (w http.ResponseWriter , r * http.Request ) {
320320 v := new (IssueRequest )
@@ -325,7 +325,7 @@ func TestIssuesService_Edit(t *testing.T) {
325325 t .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
331331 ctx := context .Background ()
@@ -334,7 +334,7 @@ func TestIssuesService_Edit(t *testing.T) {
334334 t .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" )} }
338338 if ! cmp .Equal (issue , want ) {
339339 t .Errorf ("Issues.Edit returned %+v, want %+v" , issue , want )
340340 }
@@ -529,6 +529,7 @@ func TestIssueRequest_Marshal(t *testing.T) {
529529 State : Ptr ("url" ),
530530 Milestone : Ptr (1 ),
531531 Assignees : & []string {"a" },
532+ Type : Ptr ("issue_type" ),
532533 }
533534
534535 want := `{
@@ -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
548550 testJSONMarshal (t , u , want )
@@ -582,6 +584,7 @@ func TestIssue_Marshal(t *testing.T) {
582584 NodeID : Ptr ("nid" ),
583585 TextMatches : []* TextMatch {{ObjectURL : Ptr ("ourl" )}},
584586 ActiveLockReason : Ptr ("alr" ),
587+ Type : & IssueType {Name : Ptr ("bug" )},
585588 }
586589
587590 want := `{
@@ -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
645651 testJSONMarshal (t , u , want )
0 commit comments