Github user martin-g commented on a diff in the pull request:
https://github.com/apache/wicket/pull/224#discussion_r129847480
--- Diff:
wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
---
@@ -2321,7 +2323,23 @@ public Result isComponentOnAjaxResponse(final
Component component)
boolean isComponentInAjaxResponse =
ajaxResponse.matches("(?s).*<component id=\"" +
markupId + "\"[^>]*?>.*");
failMessage = "Component wasn't found in the AJAX response. " +
componentInfo;
- return isTrue(failMessage, isComponentInAjaxResponse);
+ result = isTrue(failMessage, isComponentInAjaxResponse);
+
+ // Check if the component has been included as part of an
enclosure render
+ Enclosure enclosure =
getLastRenderedPage().visitChildren(Enclosure.class, (Enclosure enc,
IVisit<Enclosure> visit) -> {
+ if
(AjaxEnclosureListener.isControllerOfEnclosure(component, enc)){
+ visit.stop(enc);
+ }
+ });
+
+ if (enclosure != null){
+ failMessage = "Component's enclosure was not found in
the AJAX response. " + enclosure.toString();
--- End diff --
No need to call `.toString()` explicitly.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---