(t *testing.T)
| 334 | } |
| 335 | |
| 336 | func TestBrowseModelShowsKeyboardHelp(t *testing.T) { |
| 337 | t.Parallel() |
| 338 | |
| 339 | // Given the main extension catalog is displayed |
| 340 | ios, _, _, _ := iostreams.Test() |
| 341 | ios.SetColorEnabled(true) |
| 342 | model := newBrowseModel(ExtBrowseOpts{IO: ios}, []extEntry{ |
| 343 | {FullName: "cli/gh-cool", description: "terminal tools"}, |
| 344 | }) |
| 345 | |
| 346 | // When the user presses ? |
| 347 | updateBrowseModel(t, model, keyPress('?')) |
| 348 | |
| 349 | // Then the interface displays the available control groups |
| 350 | view := model.View().Content |
| 351 | assert.Contains(t, view, "Application") |
| 352 | assert.Contains(t, view, "Navigation") |
| 353 | assert.Contains(t, view, "Extension Management") |
| 354 | assert.Contains(t, view, "Filtering") |
| 355 | assert.Contains(t, view, "Readmes") |
| 356 | assert.Regexp(t, `\x1b\[[0-9;]*1[0-9;]*mApplication\x1b\[0m`, view) |
| 357 | assert.Regexp(t, `\x1b\[[0-9;]*1[0-9;]*m\?\x1b\[0m: toggle help`, view) |
| 358 | } |
| 359 | |
| 360 | func TestBrowseModelShowsKeyboardHelpForShiftedQuestionMark(t *testing.T) { |
| 361 | t.Parallel() |
nothing calls this directly
no test coverage detected