(t *testing.T)
| 197 | } |
| 198 | |
| 199 | func TestBrowseModelFiltersExtensions(t *testing.T) { |
| 200 | t.Parallel() |
| 201 | |
| 202 | // Given a catalog with extensions that have different names and descriptions |
| 203 | model := newBrowseModel(ExtBrowseOpts{}, []extEntry{ |
| 204 | {FullName: "cli/gh-cool", description: "terminal tools"}, |
| 205 | {FullName: "octo/gh-triage", description: "issue management"}, |
| 206 | }) |
| 207 | |
| 208 | // When the user focuses the filter and enters cool |
| 209 | updateBrowseModel(t, model, keyPress('/')) |
| 210 | for _, r := range "cool" { |
| 211 | updateBrowseModel(t, model, keyPress(r)) |
| 212 | } |
| 213 | |
| 214 | // Then only the matching extension is displayed |
| 215 | view := model.View().Content |
| 216 | assert.Contains(t, view, "cli/gh-cool") |
| 217 | assert.NotContains(t, view, "octo/gh-triage") |
| 218 | } |
| 219 | |
| 220 | func TestBrowseModelFiltersExtensionsByDisplayedStatus(t *testing.T) { |
| 221 | t.Parallel() |
nothing calls this directly
no test coverage detected