@@ -314,7 +314,7 @@ func TestIssuesService_Edit(t *testing.T) {
314
314
t .Parallel ()
315
315
client , mux , _ := setup (t )
316
316
317
- input := & IssueRequest {Title : Ptr ("t" )}
317
+ input := & IssueRequest {Title : Ptr ("t" ), Type : Ptr ( "bug" ) }
318
318
319
319
mux .HandleFunc ("/repos/o/r/issues/1" , func (w http.ResponseWriter , r * http.Request ) {
320
320
v := new (IssueRequest )
@@ -325,7 +325,7 @@ func TestIssuesService_Edit(t *testing.T) {
325
325
t .Errorf ("Request body = %+v, want %+v" , v , input )
326
326
}
327
327
328
- fmt .Fprint (w , `{"number":1}` )
328
+ fmt .Fprint (w , `{"number":1, "type": {"name": "bug"} }` )
329
329
})
330
330
331
331
ctx := context .Background ()
@@ -334,7 +334,7 @@ func TestIssuesService_Edit(t *testing.T) {
334
334
t .Errorf ("Issues.Edit returned error: %v" , err )
335
335
}
336
336
337
- want := & Issue {Number : Ptr (1 )}
337
+ want := & Issue {Number : Ptr (1 ), Type : & IssueType { Name : Ptr ( "bug" )} }
338
338
if ! cmp .Equal (issue , want ) {
339
339
t .Errorf ("Issues.Edit returned %+v, want %+v" , issue , want )
340
340
}
@@ -529,6 +529,7 @@ func TestIssueRequest_Marshal(t *testing.T) {
529
529
State : Ptr ("url" ),
530
530
Milestone : Ptr (1 ),
531
531
Assignees : & []string {"a" },
532
+ Type : Ptr ("issue_type" ),
532
533
}
533
534
534
535
want := `{
@@ -542,7 +543,8 @@ func TestIssueRequest_Marshal(t *testing.T) {
542
543
"milestone": 1,
543
544
"assignees": [
544
545
"a"
545
- ]
546
+ ],
547
+ "type": "issue_type"
546
548
}`
547
549
548
550
testJSONMarshal (t , u , want )
@@ -582,6 +584,7 @@ func TestIssue_Marshal(t *testing.T) {
582
584
NodeID : Ptr ("nid" ),
583
585
TextMatches : []* TextMatch {{ObjectURL : Ptr ("ourl" )}},
584
586
ActiveLockReason : Ptr ("alr" ),
587
+ Type : & IssueType {Name : Ptr ("bug" )},
585
588
}
586
589
587
590
want := `{
@@ -639,7 +642,10 @@ func TestIssue_Marshal(t *testing.T) {
639
642
"object_url": "ourl"
640
643
}
641
644
],
642
- "active_lock_reason": "alr"
645
+ "active_lock_reason": "alr",
646
+ "type": {
647
+ "name": "bug"
648
+ }
643
649
}`
644
650
645
651
testJSONMarshal (t , u , want )
0 commit comments