@@ -581,6 +581,7 @@ func Test_CreateIssue(t *testing.T) {
581
581
assert .Contains (t , tool .InputSchema .Properties , "assignees" )
582
582
assert .Contains (t , tool .InputSchema .Properties , "labels" )
583
583
assert .Contains (t , tool .InputSchema .Properties , "milestone" )
584
+ assert .Contains (t , tool .InputSchema .Properties , "type" )
584
585
assert .ElementsMatch (t , tool .InputSchema .Required , []string {"owner" , "repo" , "title" })
585
586
586
587
// Setup mock issue for success case
@@ -593,6 +594,7 @@ func Test_CreateIssue(t *testing.T) {
593
594
Assignees : []* github.User {{Login : github .Ptr ("user1" )}, {Login : github .Ptr ("user2" )}},
594
595
Labels : []* github.Label {{Name : github .Ptr ("bug" )}, {Name : github .Ptr ("help wanted" )}},
595
596
Milestone : & github.Milestone {Number : github .Ptr (5 )},
597
+ Type : & github.IssueType {Name : github .Ptr ("Bug" )},
596
598
}
597
599
598
600
tests := []struct {
@@ -614,6 +616,7 @@ func Test_CreateIssue(t *testing.T) {
614
616
"labels" : []any {"bug" , "help wanted" },
615
617
"assignees" : []any {"user1" , "user2" },
616
618
"milestone" : float64 (5 ),
619
+ "type" : "Bug" ,
617
620
}).andThen (
618
621
mockResponse (t , http .StatusCreated , mockIssue ),
619
622
),
@@ -627,6 +630,7 @@ func Test_CreateIssue(t *testing.T) {
627
630
"assignees" : []any {"user1" , "user2" },
628
631
"labels" : []any {"bug" , "help wanted" },
629
632
"milestone" : float64 (5 ),
633
+ "type" : "Bug" ,
630
634
},
631
635
expectError : false ,
632
636
expectedIssue : mockIssue ,
@@ -722,6 +726,10 @@ func Test_CreateIssue(t *testing.T) {
722
726
assert .Equal (t , * tc .expectedIssue .Body , * returnedIssue .Body )
723
727
}
724
728
729
+ if tc .expectedIssue .Type != nil {
730
+ assert .Equal (t , * tc .expectedIssue .Type .Name , * returnedIssue .Type .Name )
731
+ }
732
+
725
733
// Check assignees if expected
726
734
if len (tc .expectedIssue .Assignees ) > 0 {
727
735
assert .Equal (t , len (tc .expectedIssue .Assignees ), len (returnedIssue .Assignees ))
@@ -1066,6 +1074,7 @@ func Test_UpdateIssue(t *testing.T) {
1066
1074
assert .Contains (t , tool .InputSchema .Properties , "labels" )
1067
1075
assert .Contains (t , tool .InputSchema .Properties , "assignees" )
1068
1076
assert .Contains (t , tool .InputSchema .Properties , "milestone" )
1077
+ assert .Contains (t , tool .InputSchema .Properties , "type" )
1069
1078
assert .ElementsMatch (t , tool .InputSchema .Required , []string {"owner" , "repo" , "issue_number" })
1070
1079
1071
1080
// Setup mock issue for success case
@@ -1078,6 +1087,7 @@ func Test_UpdateIssue(t *testing.T) {
1078
1087
Assignees : []* github.User {{Login : github .Ptr ("assignee1" )}, {Login : github .Ptr ("assignee2" )}},
1079
1088
Labels : []* github.Label {{Name : github .Ptr ("bug" )}, {Name : github .Ptr ("priority" )}},
1080
1089
Milestone : & github.Milestone {Number : github .Ptr (5 )},
1090
+ Type : & github.IssueType {Name : github .Ptr ("Bug" )},
1081
1091
}
1082
1092
1083
1093
tests := []struct {
@@ -1100,6 +1110,7 @@ func Test_UpdateIssue(t *testing.T) {
1100
1110
"labels" : []any {"bug" , "priority" },
1101
1111
"assignees" : []any {"assignee1" , "assignee2" },
1102
1112
"milestone" : float64 (5 ),
1113
+ "type" : "Bug" ,
1103
1114
}).andThen (
1104
1115
mockResponse (t , http .StatusOK , mockIssue ),
1105
1116
),
@@ -1115,6 +1126,7 @@ func Test_UpdateIssue(t *testing.T) {
1115
1126
"labels" : []any {"bug" , "priority" },
1116
1127
"assignees" : []any {"assignee1" , "assignee2" },
1117
1128
"milestone" : float64 (5 ),
1129
+ "type" : "Bug" ,
1118
1130
},
1119
1131
expectError : false ,
1120
1132
expectedIssue : mockIssue ,
@@ -1126,24 +1138,27 @@ func Test_UpdateIssue(t *testing.T) {
1126
1138
mock .PatchReposIssuesByOwnerByRepoByIssueNumber ,
1127
1139
mockResponse (t , http .StatusOK , & github.Issue {
1128
1140
Number : github .Ptr (123 ),
1129
- Title : github .Ptr ("Only Title Updated " ),
1141
+ Title : github .Ptr ("Updated Issue Title " ),
1130
1142
HTMLURL : github .Ptr ("https://github.com/owner/repo/issues/123" ),
1131
1143
State : github .Ptr ("open" ),
1144
+ Type : & github.IssueType {Name : github .Ptr ("Feature" )},
1132
1145
}),
1133
1146
),
1134
1147
),
1135
1148
requestArgs : map [string ]interface {}{
1136
1149
"owner" : "owner" ,
1137
1150
"repo" : "repo" ,
1138
1151
"issue_number" : float64 (123 ),
1139
- "title" : "Only Title Updated" ,
1152
+ "title" : "Updated Issue Title" ,
1153
+ "type" : "Feature" ,
1140
1154
},
1141
1155
expectError : false ,
1142
1156
expectedIssue : & github.Issue {
1143
1157
Number : github .Ptr (123 ),
1144
- Title : github .Ptr ("Only Title Updated " ),
1158
+ Title : github .Ptr ("Updated Issue Title " ),
1145
1159
HTMLURL : github .Ptr ("https://github.com/owner/repo/issues/123" ),
1146
1160
State : github .Ptr ("open" ),
1161
+ Type : & github.IssueType {Name : github .Ptr ("Feature" )},
1147
1162
},
1148
1163
},
1149
1164
{
@@ -1232,6 +1247,10 @@ func Test_UpdateIssue(t *testing.T) {
1232
1247
assert .Equal (t , * tc .expectedIssue .Body , * returnedIssue .Body )
1233
1248
}
1234
1249
1250
+ if tc .expectedIssue .Type != nil {
1251
+ assert .Equal (t , * tc .expectedIssue .Type .Name , * returnedIssue .Type .Name )
1252
+ }
1253
+
1235
1254
// Check assignees if expected
1236
1255
if len (tc .expectedIssue .Assignees ) > 0 {
1237
1256
assert .Len (t , returnedIssue .Assignees , len (tc .expectedIssue .Assignees ))
0 commit comments