MCPcopy
hub / github.com/basecamp/once / TestHelp_RenderBasic

Function TestHelp_RenderBasic

internal/ui/help_test.go:11–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func 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
28func TestHelp_RenderEmpty(t *testing.T) {
29 h := NewHelp()

Callers

nothing calls this directly

Calls 6

SetWidthMethod · 0.95
SetBindingsMethod · 0.95
ViewMethod · 0.95
WithHelpFunction · 0.85
NewKeyBindingFunction · 0.85
NewHelpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…