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

Function TestInlineContainer

htmlcore/context_test.go:15–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestInlineContainer(t *testing.T) {
16 b := core.NewBody()
17 assert.NoError(t, ReadHTMLString(NewContext(), b, `<button>Test</button>`))
18 if tag := b.Child(0).AsTree().Property("tag"); tag != "body" {
19 t.Errorf("expected first child to be body but got %v", tag)
20 }
21 if !strings.Contains(b.Child(0).AsTree().Child(0).AsTree().Name, "inline") {
22 t.Errorf("expected inline container for h1 but got %v", b.Child(0))
23 }
24}
25
26func TestNoInlineContainer(t *testing.T) {
27 b := core.NewBody()

Callers

nothing calls this directly

Calls 8

NewBodyFunction · 0.92
ReadHTMLStringFunction · 0.85
PropertyMethod · 0.80
ChildMethod · 0.80
NewContextFunction · 0.70
AsTreeMethod · 0.65
ErrorfMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected