Skip to content

Commit

Permalink
Add test for InputHidden (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
markuswustenberg authored Dec 22, 2020
1 parent 6efec21 commit b4918d5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/elements_test.go
Original file line number Diff line number Diff line change
@@ -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)
})
}

0 comments on commit b4918d5

Please sign in to comment.