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

Function TestButtonClick

core/button_test.go:38–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestButtonClick(t *testing.T) {
39 b := NewBody()
40 clicked := false
41 bt := NewButton(b)
42 bt.OnClick(func(e events.Event) {
43 clicked = true
44 })
45 bt.Send(events.Click)
46 assert.True(t, clicked)
47}
48
49func TestButtonMenu(t *testing.T) {
50 b := NewBody()

Callers

nothing calls this directly

Calls 4

NewBodyFunction · 0.85
NewButtonFunction · 0.85
OnClickMethod · 0.45
SendMethod · 0.45

Tested by

no test coverage detected