1
0

Add test for InputHidden ()

This commit is contained in:
Markus Wüstenberg 2020-12-22 11:12:45 +01:00 committed by GitHub
parent 6efec2175f
commit b4918d5a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
})
}