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

Function TestTextFieldClearClick

core/textfield_test.go:69–76  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

67}
68
69func TestTextFieldClearClick(t *testing.T) {
70 b := NewBody()
71 tf := NewTextField(b).AddClearButton().SetText("Hello, world!")
72 b.AssertRender(t, "text-field/clear-click", func() {
73 tf.trailingIconButton.Send(events.Click)
74 assert.Equal(t, "", tf.Text())
75 })
76}
77
78func TestTextFieldIcons(t *testing.T) {
79 b := NewBody()

Callers

nothing calls this directly

Calls 8

AssertRenderMethod · 0.95
NewBodyFunction · 0.85
NewTextFieldFunction · 0.85
AddClearButtonMethod · 0.80
EqualMethod · 0.80
SetTextMethod · 0.45
SendMethod · 0.45
TextMethod · 0.45

Tested by

no test coverage detected