Remove jodd-wot from fields tests#15965
Conversation
Replace the Jerry-based spec assertions with direct output checks and remove the unused jodd-wot test dependency wiring. Assisted-by: opencode:gpt-5.5
There was a problem hiding this comment.
Pull request overview
This PR removes the jodd-wot test dependency from the grails-fields module by replacing the prior DOM-parsing assertions in DefaultFieldTemplateSpec with direct string-based Spock assertions, and then cleaning up the related Gradle dependency and version property wiring.
Changes:
- Refactored
DefaultFieldTemplateSpecto dropJerry/jerryusage and assert against rendered output strings. - Removed
org.jodd:jodd-wotfromgrails-fieldstest dependencies. - Removed the now-unused
joddWotVersionproperty fromgradle.properties.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| grails-fields/src/test/groovy/grails/plugin/formfields/DefaultFieldTemplateSpec.groovy | Removes Lagarto/Jerry usage and replaces DOM assertions with string assertions for default/invalid/required rendering. |
| grails-fields/build.gradle | Drops the jodd-wot test dependency block (and its excludes). |
| gradle.properties | Removes the unused joddWotVersion property. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| output.contains('<div class="fieldcontain">') | ||
|
|
||
| and: | ||
| def label = root.find('label') | ||
| label.text() == 'label' | ||
| label.attr('for') == 'property' | ||
|
|
||
| and: | ||
| label.next().is('input[name=property]') | ||
| } | ||
| and: | ||
| output.contains('<label class="" for="property">label</label>') | ||
| output.indexOf('<label class="" for="property">label</label>') < output.indexOf('<input name="property">') |
| given: | ||
| model.required = true | ||
| then: | ||
| output.contains('<div class="fieldcontain error">') |
| output.contains('<div class="fieldcontain required">') | ||
|
|
||
| and: | ||
| output.contains('<span class="required-indicator">*</span>') |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.0.x #15965 +/- ##
==================================================
+ Coverage 49.5558% 49.6252% +0.0695%
- Complexity 16930 16959 +29
==================================================
Files 1999 1999
Lines 93753 93791 +38
Branches 16419 16421 +2
==================================================
+ Hits 46460 46544 +84
+ Misses 40131 40078 -53
- Partials 7162 7169 +7 🚀 New features to boost your workflow:
|
🚨 TestLens detected 1 failed test 🚨Here is what you can do:
Test SummaryCI - Groovy Joint Validation Build / build_grails > :grails-test-examples-scaffolding:integrationTest
🏷️ Commit: 19fc2a1 Test FailuresUserControllerSpec > User list (:grails-test-examples-scaffolding:integrationTest in CI - Groovy Joint Validation Build / build_grails)Muted TestsSelect tests to mute in this pull request:
Reuse successful test results:
Click the checkbox to trigger a rerun:
Learn more about TestLens at testlens.app. |
|
I'm not a fan of the string comparisons - they're fragile and brittle. Why are we not using a standard html parser? |
Summary
Removes the
jodd-wottest dependency fromgrails-fieldsby replacing its only usage with direct Spock string assertions against the rendered field output.Changes
grails-fieldstestsjodd.lagarto.dom.jerry.Jerryimports and helper usage inDefaultFieldTemplateSpec.grails-fieldsdependenciesorg.jodd:jodd-wotfrom test dependencies.joddWotVersionproperty.Verification
./gradlew.bat :grails-fields:test --tests "grails.plugin.formfields.DefaultFieldTemplateSpec"./gradlew.bat :grails-fields:testChecklist
jodd-wot/joddreferences.