(t *testing.T)
| 76 | } |
| 77 | |
| 78 | func 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 | |
| 98 | func TestBind(t *testing.T) { |
| 99 | elem := Bind(`<div>clicked</div>`, nil) |
nothing calls this directly
no test coverage detected