(t *testing.T)
| 82 | } |
| 83 | |
| 84 | func TestRunDelete_User(t *testing.T) { |
| 85 | defer gock.Off() |
| 86 | gock.Observe(gock.DumpRequest) |
| 87 | |
| 88 | // get user ID |
| 89 | gock.New("https://api.github.com"). |
| 90 | Post("/graphql"). |
| 91 | MatchType("json"). |
| 92 | JSON(map[string]interface{}{ |
| 93 | "query": "query UserOrgOwner.*", |
| 94 | "variables": map[string]interface{}{ |
| 95 | "login": "monalisa", |
| 96 | }, |
| 97 | }). |
| 98 | Reply(200). |
| 99 | JSON(map[string]interface{}{ |
| 100 | "data": map[string]interface{}{ |
| 101 | "user": map[string]interface{}{ |
| 102 | "id": "an ID", |
| 103 | }, |
| 104 | }, |
| 105 | "errors": []interface{}{ |
| 106 | map[string]interface{}{ |
| 107 | "type": "NOT_FOUND", |
| 108 | "path": []string{"organization"}, |
| 109 | }, |
| 110 | }, |
| 111 | }) |
| 112 | |
| 113 | // get project ID |
| 114 | gock.New("https://api.github.com"). |
| 115 | Post("/graphql"). |
| 116 | MatchType("json"). |
| 117 | JSON(map[string]interface{}{ |
| 118 | "query": "query UserProject.*", |
| 119 | "variables": map[string]interface{}{ |
| 120 | "login": "monalisa", |
| 121 | "number": 1, |
| 122 | "firstItems": 0, |
| 123 | "afterItems": nil, |
| 124 | "firstFields": 0, |
| 125 | "afterFields": nil, |
| 126 | }, |
| 127 | }). |
| 128 | Reply(200). |
| 129 | JSON(map[string]interface{}{ |
| 130 | "data": map[string]interface{}{ |
| 131 | "user": map[string]interface{}{ |
| 132 | "projectV2": map[string]interface{}{ |
| 133 | "id": "an ID", |
| 134 | }, |
| 135 | }, |
| 136 | }, |
| 137 | }) |
| 138 | |
| 139 | // delete project |
| 140 | gock.New("https://api.github.com"). |
| 141 | Post("/graphql"). |
nothing calls this directly
no test coverage detected