@@ -315,11 +315,9 @@ func Test_SearchIssues(t *testing.T) {
315315 ),
316316 ),
317317 requestArgs : map [string ]interface {}{
318- "query" : "repo:owner/repo is:open" ,
319- "sort" : "created" ,
320- "order" : "desc" ,
321- "page" : float64 (1 ),
322- "perPage" : float64 (30 ),
318+ "query" : "repo:owner/repo is:open" ,
319+ "sort" : "created" ,
320+ "order" : "desc" ,
323321 },
324322 expectError : false ,
325323 expectedResult : mockSearchResult ,
@@ -553,8 +551,15 @@ func Test_SearchIssues(t *testing.T) {
553551 textContent := getTextResult (t , result )
554552
555553 // Unmarshal and verify the result
554+ var paginatedResponse PaginatedResponse
555+ err = json .Unmarshal ([]byte (textContent .Text ), & paginatedResponse )
556+ require .NoError (t , err )
557+
558+ // The data field contains the search result
559+ dataBytes , err := json .Marshal (paginatedResponse .Data )
560+ require .NoError (t , err )
556561 var returnedResult github.IssuesSearchResult
557- err = json .Unmarshal ([] byte ( textContent . Text ) , & returnedResult )
562+ err = json .Unmarshal (dataBytes , & returnedResult )
558563 require .NoError (t , err )
559564 assert .Equal (t , * tc .expectedResult .Total , * returnedResult .Total )
560565 assert .Equal (t , * tc .expectedResult .IncompleteResults , * returnedResult .IncompleteResults )
@@ -747,7 +752,7 @@ func Test_ListIssues(t *testing.T) {
747752 assert .Contains (t , tool .InputSchema .Properties , "orderBy" )
748753 assert .Contains (t , tool .InputSchema .Properties , "direction" )
749754 assert .Contains (t , tool .InputSchema .Properties , "since" )
750- assert .Contains (t , tool .InputSchema .Properties , "after " )
755+ assert .Contains (t , tool .InputSchema .Properties , "cursor " )
751756 assert .ElementsMatch (t , tool .InputSchema .Required , []string {"owner" , "repo" })
752757
753758 // Mock issues data
@@ -865,7 +870,7 @@ func Test_ListIssues(t *testing.T) {
865870 "states" : []interface {}{"OPEN" , "CLOSED" },
866871 "orderBy" : "CREATED_AT" ,
867872 "direction" : "DESC" ,
868- "first" : float64 (30 ),
873+ "first" : float64 (10 ),
869874 "after" : (* string )(nil ),
870875 }
871876
@@ -875,7 +880,7 @@ func Test_ListIssues(t *testing.T) {
875880 "states" : []interface {}{"OPEN" },
876881 "orderBy" : "CREATED_AT" ,
877882 "direction" : "DESC" ,
878- "first" : float64 (30 ),
883+ "first" : float64 (10 ),
879884 "after" : (* string )(nil ),
880885 }
881886
@@ -885,7 +890,7 @@ func Test_ListIssues(t *testing.T) {
885890 "states" : []interface {}{"CLOSED" },
886891 "orderBy" : "CREATED_AT" ,
887892 "direction" : "DESC" ,
888- "first" : float64 (30 ),
893+ "first" : float64 (10 ),
889894 "after" : (* string )(nil ),
890895 }
891896
@@ -896,7 +901,7 @@ func Test_ListIssues(t *testing.T) {
896901 "labels" : []interface {}{"bug" , "enhancement" },
897902 "orderBy" : "CREATED_AT" ,
898903 "direction" : "DESC" ,
899- "first" : float64 (30 ),
904+ "first" : float64 (10 ),
900905 "after" : (* string )(nil ),
901906 }
902907
@@ -906,7 +911,7 @@ func Test_ListIssues(t *testing.T) {
906911 "states" : []interface {}{"OPEN" , "CLOSED" },
907912 "orderBy" : "CREATED_AT" ,
908913 "direction" : "DESC" ,
909- "first" : float64 (30 ),
914+ "first" : float64 (10 ),
910915 "after" : (* string )(nil ),
911916 }
912917
@@ -2580,7 +2585,7 @@ func Test_GetSubIssues(t *testing.T) {
25802585 mock .GetReposIssuesSubIssuesByOwnerByRepoByIssueNumber ,
25812586 expectQueryParams (t , map [string ]string {
25822587 "page" : "2" ,
2583- "per_page" : "10 " ,
2588+ "per_page" : "11 " ,
25842589 }).andThen (
25852590 mockResponse (t , http .StatusOK , mockSubIssues ),
25862591 ),
@@ -2591,8 +2596,7 @@ func Test_GetSubIssues(t *testing.T) {
25912596 "owner" : "owner" ,
25922597 "repo" : "repo" ,
25932598 "issue_number" : float64 (42 ),
2594- "page" : float64 (2 ),
2595- "perPage" : float64 (10 ),
2599+ "cursor" : "page=2;perPage=10" ,
25962600 },
25972601 expectError : false ,
25982602 expectedSubIssues : mockSubIssues ,
0 commit comments