diff options
author | Markus Wüstenberg | 2020-09-25 09:57:47 +0200 |
---|---|---|
committer | GitHub | 2020-09-25 09:57:47 +0200 |
commit | 5da578cfdf717ff1465f729194c8192a00412881 (patch) | |
tree | 9bd1c59936f81efeb4d96edd40043301a97ed606 /el/section_test.go | |
parent | 77b64b13028d94a54491e606eed4dc759ec46dd2 (diff) | |
download | gomponents-5da578cfdf717ff1465f729194c8192a00412881.tar.lz gomponents-5da578cfdf717ff1465f729194c8192a00412881.tar.zst gomponents-5da578cfdf717ff1465f729194c8192a00412881.zip |
Group element helpers in different files (#21)
According to the section at https://developer.mozilla.org/en-US/docs/Web/HTML/Element
Diffstat (limited to 'el/section_test.go')
-rw-r--r-- | el/section_test.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/el/section_test.go b/el/section_test.go new file mode 100644 index 0000000..5147e04 --- /dev/null +++ b/el/section_test.go @@ -0,0 +1,45 @@ +package el_test + +import ( + "testing" + + g "github.com/maragudk/gomponents" + "github.com/maragudk/gomponents/assert" + "github.com/maragudk/gomponents/el" +) + +func TestH1(t *testing.T) { + t.Run("returns an h1 element", func(t *testing.T) { + assert.Equal(t, `<h1 id="headline">hat</h1>`, el.H1("hat", g.Attr("id", "headline"))) + }) +} + +func TestH2(t *testing.T) { + t.Run("returns an h2 element", func(t *testing.T) { + assert.Equal(t, `<h2 id="headline">hat</h2>`, el.H2("hat", g.Attr("id", "headline"))) + }) +} + +func TestH3(t *testing.T) { + t.Run("returns an h3 element", func(t *testing.T) { + assert.Equal(t, `<h3 id="headline">hat</h3>`, el.H3("hat", g.Attr("id", "headline"))) + }) +} + +func TestH4(t *testing.T) { + t.Run("returns an h4 element", func(t *testing.T) { + assert.Equal(t, `<h4 id="headline">hat</h4>`, el.H4("hat", g.Attr("id", "headline"))) + }) +} + +func TestH5(t *testing.T) { + t.Run("returns an h5 element", func(t *testing.T) { + assert.Equal(t, `<h5 id="headline">hat</h5>`, el.H5("hat", g.Attr("id", "headline"))) + }) +} + +func TestH6(t *testing.T) { + t.Run("returns an h6 element", func(t *testing.T) { + assert.Equal(t, `<h6 id="headline">hat</h6>`, el.H6("hat", g.Attr("id", "headline"))) + }) +} |