(t *testing.T)
| 227 | } |
| 228 | |
| 229 | func TestRunView_Org(t *testing.T) { |
| 230 | defer gock.Off() |
| 231 | |
| 232 | // get org ID |
| 233 | gock.New("https://api.github.com"). |
| 234 | Post("/graphql"). |
| 235 | MatchType("json"). |
| 236 | JSON(map[string]interface{}{ |
| 237 | "query": "query UserOrgOwner.*", |
| 238 | "variables": map[string]interface{}{ |
| 239 | "login": "github", |
| 240 | }, |
| 241 | }). |
| 242 | Reply(200). |
| 243 | JSON(map[string]interface{}{ |
| 244 | "data": map[string]interface{}{ |
| 245 | "organization": map[string]interface{}{ |
| 246 | "id": "an ID", |
| 247 | }, |
| 248 | }, |
| 249 | "errors": []interface{}{ |
| 250 | map[string]interface{}{ |
| 251 | "type": "NOT_FOUND", |
| 252 | "path": []string{"user"}, |
| 253 | }, |
| 254 | }, |
| 255 | }) |
| 256 | |
| 257 | gock.New("https://api.github.com"). |
| 258 | Post("/graphql"). |
| 259 | Reply(200). |
| 260 | JSON(` |
| 261 | {"data": |
| 262 | {"organization": |
| 263 | { |
| 264 | "login":"monalisa", |
| 265 | "projectV2": { |
| 266 | "number": 1, |
| 267 | "items": { |
| 268 | "totalCount": 10 |
| 269 | }, |
| 270 | "url":"https://github.com/orgs/github/projects/8", |
| 271 | "readme": null, |
| 272 | "fields": { |
| 273 | "nodes": [ |
| 274 | { |
| 275 | "name": "Title" |
| 276 | } |
| 277 | ] |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | } |
| 283 | `) |
| 284 | |
| 285 | client := queries.NewTestClient() |
| 286 |
nothing calls this directly
no test coverage detected