(t *testing.T)
| 191 | } |
| 192 | |
| 193 | func TestRepoNetworkUnmarshalsDatabaseID(t *testing.T) { |
| 194 | httpReg := &httpmock.Registry{} |
| 195 | defer httpReg.Verify(t) |
| 196 | |
| 197 | httpReg.Register( |
| 198 | httpmock.GraphQL(`query RepositoryNetwork\b`), |
| 199 | httpmock.StringResponse(` |
| 200 | { "data": { |
| 201 | "viewer": {"login": "OWNER"}, |
| 202 | "repo_000": { |
| 203 | "id": "REPOID", |
| 204 | "databaseId": 1234, |
| 205 | "name": "REPO", |
| 206 | "owner": {"login": "OWNER"}, |
| 207 | "viewerPermission": "WRITE", |
| 208 | "defaultBranchRef": {"name": "main"} |
| 209 | } |
| 210 | } }`)) |
| 211 | |
| 212 | result, err := RepoNetwork(newTestClient(httpReg), []ghrepo.Interface{ghrepo.New("OWNER", "REPO")}) |
| 213 | require.NoError(t, err) |
| 214 | require.Len(t, result.Repositories, 1) |
| 215 | assert.Equal(t, int64(1234), result.Repositories[0].DatabaseID) |
| 216 | } |
| 217 | |
| 218 | func TestIssueRepoInfo_notFound(t *testing.T) { |
| 219 | httpReg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected