(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestHelp_RenderBasic(t *testing.T) { |
| 12 | bindings := []key.Binding{ |
| 13 | WithHelp(NewKeyBinding("s"), "s", "settings"), |
| 14 | WithHelp(NewKeyBinding("g"), "g", "logs"), |
| 15 | } |
| 16 | |
| 17 | h := NewHelp() |
| 18 | h.SetWidth(80) |
| 19 | h.SetBindings(bindings) |
| 20 | result := h.View() |
| 21 | |
| 22 | assert.Contains(t, result, "s") |
| 23 | assert.Contains(t, result, "settings") |
| 24 | assert.Contains(t, result, "g") |
| 25 | assert.Contains(t, result, "logs") |
| 26 | } |
| 27 | |
| 28 | func TestHelp_RenderEmpty(t *testing.T) { |
| 29 | h := NewHelp() |
nothing calls this directly
no test coverage detected
searching dependent graphs…