Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Sep 8, 2024
1 parent d422000 commit 7c6c04c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ class FormFieldsTagLib {
}

List classes = [widgetAttrs['class']?:'']
if (model.invalid) classes << (widgetAttrs.remove('invalidClass')?:'error')
if (model.required) classes << (widgetAttrs.remove('requiredClass')?:'required')
if (model.invalid) classes << (widgetAttrs.remove('invalidClass')?:'')
if (model.required) classes << (widgetAttrs.remove('requiredClass')?:'')
widgetAttrs['class'] = classes.join(' ').trim()
if (widgetAttrs['class'].isEmpty()) {
widgetAttrs.remove('class')
Expand All @@ -214,7 +214,7 @@ class FormFieldsTagLib {
if (template) {
out << render(template: template.path, plugin: template.plugin, model: model + [attrs: wrapperAttrs] + wrapperAttrs)
} else {
out << renderDefaultField(wrapperAttrs, model)
out << renderDefaultField(model, wrapperAttrs)
}
}
}
Expand Down Expand Up @@ -628,7 +628,7 @@ class FormFieldsTagLib {
message ?: defaultMessage
}

private CharSequence renderDefaultField(Map attrs, Map model) {
protected CharSequence renderDefaultField(Map model, Map attrs = [:]) {
List classes = [attrs['class']?:'fieldcontain']
if (model.invalid) classes << (attrs.remove('invalidClass')?:'error')
if (model.required) classes << (attrs.remove('requiredClass')?:'required')
Expand Down

0 comments on commit 7c6c04c

Please sign in to comment.