MCPcopy
hub / github.com/wavetermdev/waveterm / Test1

Function Test1

pkg/vdom/vdom_test.go:78–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func Test1(t *testing.T) {
79 log.Printf("hello!\n")
80 testContext := &TestContext{ButtonId: ""}
81 ctx := context.WithValue(context.Background(), renderContextKey, testContext)
82 root := MakeRoot()
83 root.SetOuterCtx(ctx)
84 root.RegisterComponent("Page", Page)
85 root.RegisterComponent("Button", Button)
86 root.Render(E("Page"))
87 if root.Root == nil {
88 t.Fatalf("root.Root is nil")
89 }
90 printVDom(root)
91 root.RunWork()
92 printVDom(root)
93 root.Event(testContext.ButtonId, "onClick", VDomEvent{EventType: "onClick"})
94 root.RunWork()
95 printVDom(root)
96}
97
98func TestBind(t *testing.T) {
99 elem := Bind(`<div>clicked</div>`, nil)

Callers

nothing calls this directly

Calls 8

EFunction · 0.85
printVDomFunction · 0.85
SetOuterCtxMethod · 0.80
MakeRootFunction · 0.70
RegisterComponentMethod · 0.45
RenderMethod · 0.45
RunWorkMethod · 0.45
EventMethod · 0.45

Tested by

no test coverage detected