about summary refs log tree commit diff stats
path: root/attr/forms_test.go
blob: d222464cfd0e4e13d4bdbf41d33734ec6a8888b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package attr_test

import (
	"testing"

	g "github.com/maragudk/gomponents"
	"github.com/maragudk/gomponents/assert"
	"github.com/maragudk/gomponents/attr"
)

func TestForms(t *testing.T) {
	t.Run("adds placeholder and required attributes", func(t *testing.T) {
		e := g.El("input", attr.Placeholder("hat"), attr.Required())
		assert.Equal(t, `<input placeholder="hat" required />`, e)
	})
}