You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by ro...@apache.org on 2011/10/20 06:48:26 UTC

svn commit: r1186612 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js test/java/org/apache/tapestry5/integration/app1/FormTests.java

Author: robertdzeigler
Date: Thu Oct 20 04:48:26 2011
New Revision: 1186612

URL: http://svn.apache.org/viewvc?rev=1186612&view=rev
Log:
TAP5-1408: datefield popup does not have option to cancel. Fix and properly 
test for issue where selecting a month from the "month menu" would prematurely 
close the datepicker.  Previous version of the test was checking the visibility
too quickly so the picker was still visible for the test even though it would 
disappear a few milliseconds later.

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js?rev=1186612&r1=1186611&r2=1186612&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js Thu Oct 20 04:48:26 2011
@@ -328,7 +328,7 @@ DatePicker.prototype.create = function (
         var insideDatePicker = null;
         var parent = targ.parentNode;
         while (parent != null) {
-            if (parent.className == 'datePicker'/* || parent.className == 'labelPopup'*/) {
+            if (parent.className == 'datePicker' || parent.className == 'labelPopup') {
                 insideDatePicker = parent;
                 break;
             }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java?rev=1186612&r1=1186611&r2=1186612&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java Thu Oct 20 04:48:26 2011
@@ -345,6 +345,13 @@ public class FormTests extends TapestryC
         click("css=div.labelPopup a");
 
         waitForCondition("!selenium.isElementPresent('css=div.labelPopup')", PAGE_LOAD_TIMEOUT);
+        //It's basically impossible to express "wait until the popup doesn't disappear" 
+        //Instead, we take advantage of knowing that the datepicker disappears with this bug /almost/ 
+        //immediately after picking the month label, so we sleep the test for a few seconds to provide
+        //ammple time for the bug to manifest. 
+        try {
+            Thread.sleep(1500);
+        } catch (Exception e){/*Ignore the interrupted exception */}
         assertTrue(isVisible("css=div.datePicker"));
     }