(t *testing.T)
| 52 | } |
| 53 | |
| 54 | func TestHelp_RenderWraps(t *testing.T) { |
| 55 | bindings := []key.Binding{ |
| 56 | WithHelp(NewKeyBinding("a"), "a", "aaaaaaaaa"), |
| 57 | WithHelp(NewKeyBinding("b"), "b", "bbbbbbbbb"), |
| 58 | WithHelp(NewKeyBinding("c"), "c", "ccccccccc"), |
| 59 | } |
| 60 | |
| 61 | h := NewHelp() |
| 62 | h.SetWidth(30) // narrow enough to force wrapping |
| 63 | h.SetBindings(bindings) |
| 64 | result := h.View() |
| 65 | |
| 66 | lines := strings.Split(result, "\n") |
| 67 | assert.Greater(t, len(lines), 1, "should wrap to multiple lines") |
| 68 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…