about summary refs log tree commit diff stats
path: root/el/section_test.go
blob: 5147e041448bf1be644c9e43ab9a3144fb79a014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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")))
	})
}