diff options
author | Markus Wüstenberg | 2020-12-22 11:12:45 +0100 |
---|---|---|
committer | GitHub | 2020-12-22 11:12:45 +0100 |
commit | b4918d5a63434e162e5547cf0e8461fcd1931765 (patch) | |
tree | 01a1bfedb18aff70ed5791e9730b9b3400346578 /components | |
parent | 6efec2175f61125c3cae694b9a4327a990484ca0 (diff) | |
download | gomponents-b4918d5a63434e162e5547cf0e8461fcd1931765.tar.lz gomponents-b4918d5a63434e162e5547cf0e8461fcd1931765.tar.zst gomponents-b4918d5a63434e162e5547cf0e8461fcd1931765.zip |
Add test for InputHidden (#60)
Diffstat (limited to 'components')
-rw-r--r-- | components/elements_test.go | 16 |
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) + }) +} |