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

Function TestFormAppendItems_FocusStability

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

Source from the content-addressed store, hash-verified

337}
338
339func TestFormAppendItems_FocusStability(t *testing.T) {
340 form := NewForm("Done",
341 FormItem{Label: "First", Field: NewTextField("first")},
342 FormItem{Label: "Second", Field: NewTextField("second")},
343 )
344 formPressTab(&form)
345 assert.Equal(t, 1, form.Focused())
346
347 form.AppendItems(FormItem{Label: "Third", Field: NewTextField("third")})
348 assert.Equal(t, 1, form.Focused(), "focus unchanged after append")
349}
350
351// Helpers
352

Callers

nothing calls this directly

Calls 6

FocusedMethod · 0.95
AppendItemsMethod · 0.95
NewFormFunction · 0.85
NewTextFieldFunction · 0.85
formPressTabFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…