(t *testing.T)
| 155 | } |
| 156 | |
| 157 | func TestList(t *testing.T) { |
| 158 | const listURL = "https://api.github.com/repos/monalisa/monas-cafe/issues/142/artifacts" |
| 159 | const tenancyListURL = "https://api.monas-cafe.ghe.com/repos/monalisa/monas-cafe/issues/142/artifacts" |
| 160 | |
| 161 | createdAt := time.Date(2026, 9, 21, 23, 0, 0, 0, time.UTC) |
| 162 | updatedAt := time.Date(2026, 9, 24, 21, 0, 0, 0, time.UTC) |
| 163 | |
| 164 | tests := []struct { |
| 165 | name string |
| 166 | repo ghrepo.Interface |
| 167 | artifactType string |
| 168 | limit int |
| 169 | pages []httpmock.Responder |
| 170 | want []Artifact |
| 171 | wantNumbers []int |
| 172 | wantURLs []string |
| 173 | wantErr string |
| 174 | }{ |
| 175 | { |
| 176 | name: "decodes every field, and null users and timestamps", |
| 177 | repo: ghrepo.New("monalisa", "monas-cafe"), |
| 178 | pages: []httpmock.Responder{ |
| 179 | httpmock.StringResponse(`[ |
| 180 | { |
| 181 | "id": 6626, |
| 182 | "number": 2, |
| 183 | "type": "generic", |
| 184 | "name": "OAuth callback plan", |
| 185 | "body": "# OAuth callback plan", |
| 186 | "body_html": "<h1>OAuth callback plan</h1>", |
| 187 | "description": "Register the callback URL.", |
| 188 | "creator": {"login": "hubot", "id": 2}, |
| 189 | "updated_by_actor": {"login": "monalisa", "id": 1}, |
| 190 | "created_at": "2026-09-21T23:00:00Z", |
| 191 | "updated_at": "2026-09-24T21:00:00Z", |
| 192 | "html_url": "https://github.com/monalisa/monas-cafe/issues/142/artifacts/2" |
| 193 | }, |
| 194 | { |
| 195 | "id": 6627, |
| 196 | "number": 3, |
| 197 | "type": "link", |
| 198 | "name": "Staging OAuth runbook", |
| 199 | "body": "https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook", |
| 200 | "body_html": "", |
| 201 | "description": "", |
| 202 | "creator": null, |
| 203 | "updated_by_actor": null, |
| 204 | "created_at": null, |
| 205 | "updated_at": null, |
| 206 | "html_url": "https://github.com/monalisa/monas-cafe/issues/142/artifacts/3" |
| 207 | } |
| 208 | ]`), |
| 209 | }, |
| 210 | want: []Artifact{ |
| 211 | { |
| 212 | ID: 6626, |
| 213 | Number: 2, |
| 214 | Type: "generic", |
nothing calls this directly
no test coverage detected