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

Function TestForm_EnterAdvancesFocus

internal/ui/form_test.go:49–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestForm_EnterAdvancesFocus(t *testing.T) {
50 form := NewForm("Submit",
51 FormItem{Label: "First", Field: NewTextField("first")},
52 FormItem{Label: "Second", Field: NewTextField("second")},
53 )
54
55 formPressEnter(&form)
56 assert.Equal(t, 1, form.Focused())
57
58 formPressEnter(&form)
59 assert.Equal(t, 2, form.Focused(), "submit button")
60}
61
62func TestForm_SubmitAction(t *testing.T) {
63 form := NewForm("Done",

Callers

nothing calls this directly

Calls 5

FocusedMethod · 0.95
NewFormFunction · 0.85
NewTextFieldFunction · 0.85
formPressEnterFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…