Add test for InputHidden (#60)
This commit is contained in:
parent
6efec2175f
commit
b4918d5a63
16
components/elements_test.go
Normal file
16
components/elements_test.go
Normal file
@ -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)
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user