MCPcopy Create free account
hub / github.com/cogentcore/core / TestChooserEditableAllowNewTextFieldClick

Function TestChooserEditableAllowNewTextFieldClick

core/chooser_test.go:124–135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func TestChooserEditableAllowNewTextFieldClick(t *testing.T) {
125 b := NewBody()
126 b.Styler(func(s *styles.Style) {
127 s.Min.Set(units.Em(20), units.Em(10))
128 })
129 ch := NewChooser(b).SetEditable(true).SetAllowNew(true).SetStrings("Newest", "Oldest", "Popular")
130 b.AssertRenderScreen(t, "chooser/editable-allow-new-text-field-click", func() {
131 ch.textField.HandleEvent(events.NewKey(events.KeyChord, 'O', 0, 0))
132 }, func() {
133 ch.textField.Send(events.Click)
134 })
135}
136
137func TestChooserChange(t *testing.T) {
138 b := NewBody()

Callers

nothing calls this directly

Calls 12

AssertRenderScreenMethod · 0.95
EmFunction · 0.92
NewKeyFunction · 0.92
NewBodyFunction · 0.85
NewChooserFunction · 0.85
StylerMethod · 0.80
SetAllowNewMethod · 0.80
SetEditableMethod · 0.80
HandleEventMethod · 0.80
SetMethod · 0.65
SetStringsMethod · 0.45
SendMethod · 0.45

Tested by

no test coverage detected