@@ -581,6 +581,7 @@ func Test_CreateIssue(t *testing.T) {
581581 assert .Contains (t , tool .InputSchema .Properties , "assignees" )
582582 assert .Contains (t , tool .InputSchema .Properties , "labels" )
583583 assert .Contains (t , tool .InputSchema .Properties , "milestone" )
584+ assert .Contains (t , tool .InputSchema .Properties , "type" )
584585 assert .ElementsMatch (t , tool .InputSchema .Required , []string {"owner" , "repo" , "title" })
585586
586587 // Setup mock issue for success case
@@ -593,6 +594,7 @@ func Test_CreateIssue(t *testing.T) {
593594 Assignees : []* github.User {{Login : github .Ptr ("user1" )}, {Login : github .Ptr ("user2" )}},
594595 Labels : []* github.Label {{Name : github .Ptr ("bug" )}, {Name : github .Ptr ("help wanted" )}},
595596 Milestone : & github.Milestone {Number : github .Ptr (5 )},
597+ Type : & github.IssueType {Name : github .Ptr ("Bug" )},
596598 }
597599
598600 tests := []struct {
@@ -614,6 +616,7 @@ func Test_CreateIssue(t *testing.T) {
614616 "labels" : []any {"bug" , "help wanted" },
615617 "assignees" : []any {"user1" , "user2" },
616618 "milestone" : float64 (5 ),
619+ "type" : "Bug" ,
617620 }).andThen (
618621 mockResponse (t , http .StatusCreated , mockIssue ),
619622 ),
@@ -627,6 +630,7 @@ func Test_CreateIssue(t *testing.T) {
627630 "assignees" : []any {"user1" , "user2" },
628631 "labels" : []any {"bug" , "help wanted" },
629632 "milestone" : float64 (5 ),
633+ "type" : "Bug" ,
630634 },
631635 expectError : false ,
632636 expectedIssue : mockIssue ,
@@ -722,6 +726,10 @@ func Test_CreateIssue(t *testing.T) {
722726 assert .Equal (t , * tc .expectedIssue .Body , * returnedIssue .Body )
723727 }
724728
729+ if tc .expectedIssue .Type != nil {
730+ assert .Equal (t , * tc .expectedIssue .Type .Name , * returnedIssue .Type .Name )
731+ }
732+
725733 // Check assignees if expected
726734 if len (tc .expectedIssue .Assignees ) > 0 {
727735 assert .Equal (t , len (tc .expectedIssue .Assignees ), len (returnedIssue .Assignees ))
@@ -1066,6 +1074,7 @@ func Test_UpdateIssue(t *testing.T) {
10661074 assert .Contains (t , tool .InputSchema .Properties , "labels" )
10671075 assert .Contains (t , tool .InputSchema .Properties , "assignees" )
10681076 assert .Contains (t , tool .InputSchema .Properties , "milestone" )
1077+ assert .Contains (t , tool .InputSchema .Properties , "type" )
10691078 assert .ElementsMatch (t , tool .InputSchema .Required , []string {"owner" , "repo" , "issue_number" })
10701079
10711080 // Setup mock issue for success case
@@ -1078,6 +1087,7 @@ func Test_UpdateIssue(t *testing.T) {
10781087 Assignees : []* github.User {{Login : github .Ptr ("assignee1" )}, {Login : github .Ptr ("assignee2" )}},
10791088 Labels : []* github.Label {{Name : github .Ptr ("bug" )}, {Name : github .Ptr ("priority" )}},
10801089 Milestone : & github.Milestone {Number : github .Ptr (5 )},
1090+ Type : & github.IssueType {Name : github .Ptr ("Bug" )},
10811091 }
10821092
10831093 tests := []struct {
@@ -1100,6 +1110,7 @@ func Test_UpdateIssue(t *testing.T) {
11001110 "labels" : []any {"bug" , "priority" },
11011111 "assignees" : []any {"assignee1" , "assignee2" },
11021112 "milestone" : float64 (5 ),
1113+ "type" : "Bug" ,
11031114 }).andThen (
11041115 mockResponse (t , http .StatusOK , mockIssue ),
11051116 ),
@@ -1115,6 +1126,7 @@ func Test_UpdateIssue(t *testing.T) {
11151126 "labels" : []any {"bug" , "priority" },
11161127 "assignees" : []any {"assignee1" , "assignee2" },
11171128 "milestone" : float64 (5 ),
1129+ "type" : "Bug" ,
11181130 },
11191131 expectError : false ,
11201132 expectedIssue : mockIssue ,
@@ -1126,24 +1138,27 @@ func Test_UpdateIssue(t *testing.T) {
11261138 mock .PatchReposIssuesByOwnerByRepoByIssueNumber ,
11271139 mockResponse (t , http .StatusOK , & github.Issue {
11281140 Number : github .Ptr (123 ),
1129- Title : github .Ptr ("Only Title Updated " ),
1141+ Title : github .Ptr ("Updated Issue Title " ),
11301142 HTMLURL : github .Ptr ("https://github.com/owner/repo/issues/123" ),
11311143 State : github .Ptr ("open" ),
1144+ Type : & github.IssueType {Name : github .Ptr ("Feature" )},
11321145 }),
11331146 ),
11341147 ),
11351148 requestArgs : map [string ]interface {}{
11361149 "owner" : "owner" ,
11371150 "repo" : "repo" ,
11381151 "issue_number" : float64 (123 ),
1139- "title" : "Only Title Updated" ,
1152+ "title" : "Updated Issue Title" ,
1153+ "type" : "Feature" ,
11401154 },
11411155 expectError : false ,
11421156 expectedIssue : & github.Issue {
11431157 Number : github .Ptr (123 ),
1144- Title : github .Ptr ("Only Title Updated " ),
1158+ Title : github .Ptr ("Updated Issue Title " ),
11451159 HTMLURL : github .Ptr ("https://github.com/owner/repo/issues/123" ),
11461160 State : github .Ptr ("open" ),
1161+ Type : & github.IssueType {Name : github .Ptr ("Feature" )},
11471162 },
11481163 },
11491164 {
@@ -1232,6 +1247,10 @@ func Test_UpdateIssue(t *testing.T) {
12321247 assert .Equal (t , * tc .expectedIssue .Body , * returnedIssue .Body )
12331248 }
12341249
1250+ if tc .expectedIssue .Type != nil {
1251+ assert .Equal (t , * tc .expectedIssue .Type .Name , * returnedIssue .Type .Name )
1252+ }
1253+
12351254 // Check assignees if expected
12361255 if len (tc .expectedIssue .Assignees ) > 0 {
12371256 assert .Len (t , returnedIssue .Assignees , len (tc .expectedIssue .Assignees ))
0 commit comments