(t *testing.T)
| 235 | } |
| 236 | |
| 237 | func TestRunCopy_Org(t *testing.T) { |
| 238 | defer gock.Off() |
| 239 | // gock.Observe(gock.DumpRequest) |
| 240 | |
| 241 | // get org project ID |
| 242 | gock.New("https://api.github.com"). |
| 243 | Post("/graphql"). |
| 244 | MatchType("json"). |
| 245 | JSON(map[string]interface{}{ |
| 246 | "query": "query OrgProject.*", |
| 247 | "variables": map[string]interface{}{ |
| 248 | "login": "github", |
| 249 | "number": 1, |
| 250 | "firstItems": 0, |
| 251 | "afterItems": nil, |
| 252 | "firstFields": 0, |
| 253 | "afterFields": nil, |
| 254 | }, |
| 255 | }). |
| 256 | Reply(200). |
| 257 | JSON(map[string]interface{}{ |
| 258 | "data": map[string]interface{}{ |
| 259 | "organization": map[string]interface{}{ |
| 260 | "projectV2": map[string]string{ |
| 261 | "id": "an ID", |
| 262 | }, |
| 263 | }, |
| 264 | }, |
| 265 | }) |
| 266 | // get source org ID |
| 267 | gock.New("https://api.github.com"). |
| 268 | Post("/graphql"). |
| 269 | MatchType("json"). |
| 270 | JSON(map[string]interface{}{ |
| 271 | "query": "query UserOrgOwner.*", |
| 272 | "variables": map[string]string{ |
| 273 | "login": "github", |
| 274 | }, |
| 275 | }). |
| 276 | Reply(200). |
| 277 | JSON(map[string]interface{}{ |
| 278 | "data": map[string]interface{}{ |
| 279 | "organization": map[string]interface{}{ |
| 280 | "id": "an ID", |
| 281 | "login": "github", |
| 282 | }, |
| 283 | }, |
| 284 | "errors": []interface{}{ |
| 285 | map[string]interface{}{ |
| 286 | "type": "NOT_FOUND", |
| 287 | "path": []string{"user"}, |
| 288 | }, |
| 289 | }, |
| 290 | }) |
| 291 | |
| 292 | // get target source org ID |
| 293 | gock.New("https://api.github.com"). |
| 294 | Post("/graphql"). |
nothing calls this directly
no test coverage detected