Skip to content

Commit

Permalink
Fix boostrap tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Walderman committed Oct 4, 2019
1 parent fa76991 commit ca0da11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions form/bootstrap/form_for_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func Test_CheckBox(t *testing.T) {
r := require.New(t)
f := bootstrap.NewFormFor(struct{ Name string }{}, tags.Options{})
l := f.CheckboxTag("Name", tags.Options{"label": "Custom"})
r.Equal(`<div class="form-group"><label><input class="" id="-Name" name="Name" type="checkbox" value="true" /> Custom</label></div>`, l.String())
r.Equal(`<div class="form-group"><label><input class="" id="-Name" name="Name" type="checkbox" value="" /><input name="Name" type="hidden" value="" /> Custom</label></div>`, l.String())
}

func Test_InputError(t *testing.T) {
Expand Down Expand Up @@ -229,7 +229,7 @@ func Test_CheckBoxError(t *testing.T) {

f := bootstrap.NewFormFor(struct{ Name string }{}, tags.Options{"errors": errors})
l := f.CheckboxTag("Name", tags.Options{"label": "Custom"})
r.Equal(`<div class="form-group has-error"><label><input class=" is-invalid" id="-Name" name="Name" type="checkbox" value="true" /> Custom</label><div class="invalid-feedback help-block">Name shoud be AJ.</div></div>`, l.String())
r.Equal(`<div class="form-group has-error"><label><input class=" is-invalid" id="-Name" name="Name" type="checkbox" value="" /><input name="Name" type="hidden" value="" /> Custom</label><div class="invalid-feedback help-block">Name shoud be AJ.</div></div>`, l.String())
}

type Person struct {
Expand Down Expand Up @@ -304,7 +304,7 @@ func Test_Field_TagOnly(t *testing.T) {
opts: tags.Options{
"tag_only": true,
},
output: `<input class="" id="-Name" name="Name" type="checkbox" value="true" />`,
output: `<input class="" id="-Name" name="Name" type="checkbox" value="" />`,
},

{
Expand Down

0 comments on commit ca0da11

Please sign in to comment.