(t *testing.T)
| 268 | } |
| 269 | |
| 270 | func Test_extList(t *testing.T) { |
| 271 | opts := ExtBrowseOpts{ |
| 272 | Logger: log.New(io.Discard, "", 0), |
| 273 | Em: &extensions.ExtensionManagerMock{ |
| 274 | InstallFunc: func(repo ghrepo.Interface, _ string) error { |
| 275 | assert.Equal(t, "cli/gh-cool", ghrepo.FullName(repo)) |
| 276 | return nil |
| 277 | }, |
| 278 | RemoveFunc: func(name string) error { |
| 279 | assert.Equal(t, "cool", name) |
| 280 | return nil |
| 281 | }, |
| 282 | }, |
| 283 | } |
| 284 | cmdFlex := tview.NewFlex() |
| 285 | app := tview.NewApplication() |
| 286 | list := tview.NewList() |
| 287 | pages := tview.NewPages() |
| 288 | ui := uiRegistry{ |
| 289 | List: list, |
| 290 | App: app, |
| 291 | CmdFlex: cmdFlex, |
| 292 | Pages: pages, |
| 293 | } |
| 294 | extEntries := []extEntry{ |
| 295 | { |
| 296 | Name: "gh-cool", |
| 297 | FullName: "cli/gh-cool", |
| 298 | Installed: false, |
| 299 | Official: true, |
| 300 | description: "it's just cool ok", |
| 301 | }, |
| 302 | { |
| 303 | Name: "gh-screensaver", |
| 304 | FullName: "vilmibm/gh-screensaver", |
| 305 | Installed: true, |
| 306 | Official: false, |
| 307 | description: "animations in your terminal", |
| 308 | }, |
| 309 | { |
| 310 | Name: "gh-triage", |
| 311 | FullName: "samcoe/gh-triage", |
| 312 | Installed: false, |
| 313 | Official: false, |
| 314 | description: "help with triage", |
| 315 | }, |
| 316 | { |
| 317 | Name: "gh-gei", |
| 318 | FullName: "github/gh-gei", |
| 319 | Installed: true, |
| 320 | Official: true, |
| 321 | description: "something something enterprise", |
| 322 | }, |
| 323 | } |
| 324 | |
| 325 | extList := newExtList(opts, ui, extEntries) |
| 326 | |
| 327 | extList.QueueUpdateDraw = func(f func()) *tview.Application { |
nothing calls this directly
no test coverage detected