I have a Java class that gets the form definition from the database, then displays html, javascript and css according to the form definition, using the set "appendable.append (...). Append (...)" to create the html- fragments that are subject to errors. Jsp and the general structure of templates (for example, FreeMarker) are not an option here, since all javascript, css, html elements are dynamic (depending on the form definition). and for some reason GWT is also not an option.
The direct modulation method that this renderer is testing is to hardcode the expected html code and then compare it with the actual output, but then the test is very fragile.
What is the best way to unit test this kind of html rendering please?
Thanks to everyone in advance.
source
share