@@ -1044,6 +1044,7 @@ func Test_UpdateIssue(t *testing.T) {
10441044 assert .Contains (t , tool .InputSchema .Properties , "title" )
10451045 assert .Contains (t , tool .InputSchema .Properties , "body" )
10461046 assert .Contains (t , tool .InputSchema .Properties , "state" )
1047+ assert .Contains (t , tool .InputSchema .Properties , "state_reason" )
10471048 assert .Contains (t , tool .InputSchema .Properties , "labels" )
10481049 assert .Contains (t , tool .InputSchema .Properties , "assignees" )
10491050 assert .Contains (t , tool .InputSchema .Properties , "milestone" )
@@ -1174,6 +1175,41 @@ func Test_UpdateIssue(t *testing.T) {
11741175 expectError : true ,
11751176 expectedErrMsg : "failed to update issue" ,
11761177 },
1178+ {
1179+ name : "close issue as not planned" ,
1180+ mockedClient : mock .NewMockedHTTPClient (
1181+ mock .WithRequestMatchHandler (
1182+ mock .PatchReposIssuesByOwnerByRepoByIssueNumber ,
1183+ expectRequestBody (t , map [string ]any {
1184+ "state" : "closed" ,
1185+ "state_reason" : "not_planned" ,
1186+ }).andThen (
1187+ mockResponse (t , http .StatusOK , & github.Issue {
1188+ Number : github .Ptr (123 ),
1189+ Title : github .Ptr ("Test Issue" ),
1190+ HTMLURL : github .Ptr ("https://github.com/owner/repo/issues/123" ),
1191+ State : github .Ptr ("closed" ),
1192+ StateReason : github .Ptr ("not_planned" ),
1193+ }),
1194+ ),
1195+ ),
1196+ ),
1197+ requestArgs : map [string ]interface {}{
1198+ "owner" : "owner" ,
1199+ "repo" : "repo" ,
1200+ "issue_number" : float64 (123 ),
1201+ "state" : "closed" ,
1202+ "state_reason" : "not_planned" ,
1203+ },
1204+ expectError : false ,
1205+ expectedIssue : & github.Issue {
1206+ Number : github .Ptr (123 ),
1207+ Title : github .Ptr ("Test Issue" ),
1208+ HTMLURL : github .Ptr ("https://github.com/owner/repo/issues/123" ),
1209+ State : github .Ptr ("closed" ),
1210+ StateReason : github .Ptr ("not_planned" ),
1211+ },
1212+ },
11771213 }
11781214
11791215 for _ , tc := range tests {
0 commit comments