package components_test import ( "testing" g "github.com/maragudk/gomponents" "github.com/maragudk/gomponents/assert" . "github.com/maragudk/gomponents/components" . "github.com/maragudk/gomponents/html" ) func TestHTML5(t *testing.T) { t.Run("returns an html5 document template", func(t *testing.T) { e := HTML5(HTML5Props{ Title: "Hat", Description: "Love hats.", Language: "en", Head: []g.Node{Link(Rel("stylesheet"), Href("/hat.css"))}, Body: []g.Node{Div()}, }) assert.Equal(t, `Hat
`, e) }) t.Run("returns no language, description, and extra head/body elements if empty", func(t *testing.T) { e := HTML5(HTML5Props{ Title: "Hat", }) assert.Equal(t, `Hat`, e) }) }