(t *testing.T)
| 174 | } |
| 175 | |
| 176 | func TestRunDelete_Org(t *testing.T) { |
| 177 | defer gock.Off() |
| 178 | gock.Observe(gock.DumpRequest) |
| 179 | |
| 180 | // get org ID |
| 181 | gock.New("https://api.github.com"). |
| 182 | Post("/graphql"). |
| 183 | MatchType("json"). |
| 184 | JSON(map[string]interface{}{ |
| 185 | "query": "query UserOrgOwner.*", |
| 186 | "variables": map[string]interface{}{ |
| 187 | "login": "github", |
| 188 | }, |
| 189 | }). |
| 190 | Reply(200). |
| 191 | JSON(map[string]interface{}{ |
| 192 | "data": map[string]interface{}{ |
| 193 | "organization": map[string]interface{}{ |
| 194 | "id": "an ID", |
| 195 | }, |
| 196 | }, |
| 197 | "errors": []interface{}{ |
| 198 | map[string]interface{}{ |
| 199 | "type": "NOT_FOUND", |
| 200 | "path": []string{"user"}, |
| 201 | }, |
| 202 | }, |
| 203 | }) |
| 204 | |
| 205 | // get project ID |
| 206 | gock.New("https://api.github.com"). |
| 207 | Post("/graphql"). |
| 208 | MatchType("json"). |
| 209 | JSON(map[string]interface{}{ |
| 210 | "query": "query OrgProject.*", |
| 211 | "variables": map[string]interface{}{ |
| 212 | "login": "github", |
| 213 | "number": 1, |
| 214 | "firstItems": 0, |
| 215 | "afterItems": nil, |
| 216 | "firstFields": 0, |
| 217 | "afterFields": nil, |
| 218 | }, |
| 219 | }). |
| 220 | Reply(200). |
| 221 | JSON(map[string]interface{}{ |
| 222 | "data": map[string]interface{}{ |
| 223 | "organization": map[string]interface{}{ |
| 224 | "projectV2": map[string]interface{}{ |
| 225 | "id": "an ID", |
| 226 | }, |
| 227 | }, |
| 228 | }, |
| 229 | }) |
| 230 | |
| 231 | // delete project |
| 232 | gock.New("https://api.github.com"). |
| 233 | Post("/graphql"). |
nothing calls this directly
no test coverage detected