(t *testing.T)
| 113 | } |
| 114 | |
| 115 | func TestRunCopy_User(t *testing.T) { |
| 116 | defer gock.Off() |
| 117 | // gock.Observe(gock.DumpRequest) |
| 118 | |
| 119 | // get user project ID |
| 120 | gock.New("https://api.github.com"). |
| 121 | Post("/graphql"). |
| 122 | MatchType("json"). |
| 123 | JSON(map[string]interface{}{ |
| 124 | "query": "query UserProject.*", |
| 125 | "variables": map[string]interface{}{ |
| 126 | "login": "monalisa", |
| 127 | "number": 1, |
| 128 | "firstItems": 0, |
| 129 | "afterItems": nil, |
| 130 | "firstFields": 0, |
| 131 | "afterFields": nil, |
| 132 | }, |
| 133 | }). |
| 134 | Reply(200). |
| 135 | JSON(map[string]interface{}{ |
| 136 | "data": map[string]interface{}{ |
| 137 | "user": map[string]interface{}{ |
| 138 | "projectV2": map[string]string{ |
| 139 | "id": "an ID", |
| 140 | }, |
| 141 | }, |
| 142 | }, |
| 143 | }) |
| 144 | |
| 145 | // get source user ID |
| 146 | gock.New("https://api.github.com"). |
| 147 | Post("/graphql"). |
| 148 | MatchType("json"). |
| 149 | JSON(map[string]interface{}{ |
| 150 | "query": "query UserOrgOwner.*", |
| 151 | "variables": map[string]string{ |
| 152 | "login": "monalisa", |
| 153 | }, |
| 154 | }). |
| 155 | Reply(200). |
| 156 | JSON(map[string]interface{}{ |
| 157 | "data": map[string]interface{}{ |
| 158 | "user": map[string]interface{}{ |
| 159 | "id": "an ID", |
| 160 | "login": "monalisa", |
| 161 | }, |
| 162 | }, |
| 163 | "errors": []interface{}{ |
| 164 | map[string]interface{}{ |
| 165 | "type": "NOT_FOUND", |
| 166 | "path": []string{"organization"}, |
| 167 | }, |
| 168 | }, |
| 169 | }) |
| 170 | |
| 171 | // get target user ID |
| 172 | gock.New("https://api.github.com"). |
nothing calls this directly
no test coverage detected