MCPcopy Index your code
hub / github.com/github/github-mcp-server / TestResolveReviewThread

Function TestResolveReviewThread

pkg/github/pullrequests_test.go:4177–4370  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

4175}
4176
4177func TestResolveReviewThread(t *testing.T) {
4178 t.Parallel()
4179
4180 tests := []struct {
4181 name string
4182 requestArgs map[string]any
4183 mockedClient *http.Client
4184 expectToolError bool
4185 expectedToolErrMsg string
4186 expectedResult string
4187 }{
4188 {
4189 name: "successful resolve thread",
4190 requestArgs: map[string]any{
4191 "method": "resolve_thread",
4192 "owner": "owner",
4193 "repo": "repo",
4194 "pullNumber": float64(42),
4195 "threadId": "PRRT_kwDOTest123",
4196 },
4197 mockedClient: githubv4mock.NewMockedHTTPClient(
4198 githubv4mock.NewMutationMatcher(
4199 struct {
4200 ResolveReviewThread struct {
4201 Thread struct {
4202 ID githubv4.ID
4203 IsResolved githubv4.Boolean
4204 }
4205 } `graphql:"resolveReviewThread(input: $input)"`
4206 }{},
4207 githubv4.ResolveReviewThreadInput{
4208 ThreadID: githubv4.ID("PRRT_kwDOTest123"),
4209 },
4210 nil,
4211 githubv4mock.DataResponse(map[string]any{
4212 "resolveReviewThread": map[string]any{
4213 "thread": map[string]any{
4214 "id": "PRRT_kwDOTest123",
4215 "isResolved": true,
4216 },
4217 },
4218 }),
4219 ),
4220 ),
4221 expectedResult: "review thread resolved successfully",
4222 },
4223 {
4224 name: "successful unresolve thread",
4225 requestArgs: map[string]any{
4226 "method": "unresolve_thread",
4227 "owner": "owner",
4228 "repo": "repo",
4229 "pullNumber": float64(42),
4230 "threadId": "PRRT_kwDOTest123",
4231 },
4232 mockedClient: githubv4mock.NewMockedHTTPClient(
4233 githubv4mock.NewMutationMatcher(
4234 struct {

Callers

nothing calls this directly

Calls 9

NewMockedHTTPClientFunction · 0.92
NewMutationMatcherFunction · 0.92
DataResponseFunction · 0.92
ErrorResponseFunction · 0.92
PullRequestReviewWriteFunction · 0.85
createMCPRequestFunction · 0.85
ContextWithDepsFunction · 0.85
getTextResultFunction · 0.85
HandlerMethod · 0.45

Tested by

no test coverage detected