(t *testing.T)
| 250 | } |
| 251 | |
| 252 | func TestRunList_tty(t *testing.T) { |
| 253 | defer gock.Off() |
| 254 | gock.Observe(gock.DumpRequest) |
| 255 | // get user ID |
| 256 | gock.New("https://api.github.com"). |
| 257 | Post("/graphql"). |
| 258 | MatchType("json"). |
| 259 | JSON(map[string]interface{}{ |
| 260 | "query": "query UserOrgOwner.*", |
| 261 | "variables": map[string]interface{}{ |
| 262 | "login": "monalisa", |
| 263 | }, |
| 264 | }). |
| 265 | Reply(200). |
| 266 | JSON(map[string]interface{}{ |
| 267 | "data": map[string]interface{}{ |
| 268 | "user": map[string]interface{}{ |
| 269 | "id": "an ID", |
| 270 | }, |
| 271 | }, |
| 272 | "errors": []interface{}{ |
| 273 | map[string]interface{}{ |
| 274 | "type": "NOT_FOUND", |
| 275 | "path": []string{"organization"}, |
| 276 | }, |
| 277 | }, |
| 278 | }) |
| 279 | |
| 280 | gock.New("https://api.github.com"). |
| 281 | Post("/graphql"). |
| 282 | Reply(200). |
| 283 | JSON(map[string]interface{}{ |
| 284 | "data": map[string]interface{}{ |
| 285 | "user": map[string]interface{}{ |
| 286 | "login": "monalisa", |
| 287 | "projectsV2": map[string]interface{}{ |
| 288 | "nodes": []interface{}{ |
| 289 | map[string]interface{}{ |
| 290 | "title": "Project 1", |
| 291 | "shortDescription": "Short description 1", |
| 292 | "url": "url1", |
| 293 | "closed": false, |
| 294 | "ID": "id-1", |
| 295 | "number": 1, |
| 296 | }, |
| 297 | map[string]interface{}{ |
| 298 | "title": "Project 2", |
| 299 | "shortDescription": "", |
| 300 | "url": "url2", |
| 301 | "closed": true, |
| 302 | "ID": "id-2", |
| 303 | "number": 2, |
| 304 | }, |
| 305 | }, |
| 306 | }, |
| 307 | }, |
| 308 | }, |
| 309 | }) |
nothing calls this directly
no test coverage detected