(t *testing.T)
| 4175 | } |
| 4176 | |
| 4177 | func 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 { |
nothing calls this directly
no test coverage detected