about summary refs log tree commit diff stats
path: root/components/elements_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'components/elements_test.go')
-rw-r--r--components/elements_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/components/elements_test.go b/components/elements_test.go
new file mode 100644
index 0000000..334ed2c
--- /dev/null
+++ b/components/elements_test.go
@@ -0,0 +1,16 @@
+package components_test
+
+import (
+	"testing"
+
+	g "github.com/maragudk/gomponents"
+	"github.com/maragudk/gomponents/assert"
+	c "github.com/maragudk/gomponents/components"
+)
+
+func TestInputHidden(t *testing.T) {
+	t.Run("returns an input element with type hidden, and the given name and value", func(t *testing.T) {
+		n := c.InputHidden("id", "partyhat", g.Attr("class", "hat"))
+		assert.Equal(t, `<input type="hidden" name="id" value="partyhat" class="hat">`, n)
+	})
+}