You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2017/01/20 08:47:34 UTC
svn commit: r1779580 - in
/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content:
20-component/010-input/40-date/date.test.js
40-test/50000-java/10-rendererBase-getCurrentValue/rendererBase-getCurrentValue.xhtml
Author: lofwyr
Date: Fri Jan 20 08:47:33 2017
New Revision: 1779580
URL: http://svn.apache.org/viewvc?rev=1779580&view=rev
Log:
fix tests
* test for date.xhtml fixed
* rendererBase-getCurrentValue.xhtml: pattern for date definded
[developed by hnoeth]
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/40-date/date.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/10-rendererBase-getCurrentValue/rendererBase-getCurrentValue.xhtml
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/40-date/date.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/40-date/date.test.js?rev=1779580&r1=1779579&r2=1779580&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/40-date/date.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/40-date/date.test.js Fri Jan 20 08:47:33 2017
@@ -44,21 +44,34 @@ QUnit.test("date with label", function (
assert.equal($dateField.val(), today);
});
-QUnit.test("submit", function (assert) {
- assert.expect(5);
+QUnit.test("submit", function(assert) {
+ assert.expect(6);
var done = assert.async();
var $dateField = jQueryFrame("#page\\:mainForm\\:formSubmit\\:input\\:\\:field");
var $dateButton = jQueryFrame("#page\\:mainForm\\:formSubmit\\:input button");
var $outField = jQueryFrame("#page\\:mainForm\\:formSubmit\\:output span");
var $submitButton = jQueryFrame("#page\\:mainForm\\:formSubmit\\:button");
+ var $days = jQueryFrame(".bootstrap-datetimepicker-widget .day");
assert.equal($dateField.val(), "22.05.2016");
assert.equal($outField.text(), "22.05.2016");
$dateButton.click();
- assert.ok(jQueryFrame(".bootstrap-datetimepicker-widget").get(0));
- jQueryFrame(".bootstrap-datetimepicker-widget .day").get(37).click(); // Choose '01.06.2016'.
+ assert.ok(jQueryFrame(".bootstrap-datetimepicker-widget").get(0),
+ ".bootstrap-datetimepicker-widget should be available");
+
+ $days = jQueryFrame($days.selector);
+ var day22 = 0;
+ for (i = 0; i < $days.length; i++) {
+ $days = jQueryFrame($days.selector);
+ if ($days.eq(i).text() == "22") {
+ day22 = i;
+ break;
+ }
+ }
+ assert.ok(jQueryFrame(".bootstrap-datetimepicker-widget .day").get(i + 10));
+ jQueryFrame(".bootstrap-datetimepicker-widget .day").get(i + 10).click(); // Choose '01.06.2016'.
assert.equal($dateField.val(), "01.06.2016");
$submitButton.click();
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/10-rendererBase-getCurrentValue/rendererBase-getCurrentValue.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/10-rendererBase-getCurrentValue/rendererBase-getCurrentValue.xhtml?rev=1779580&r1=1779579&r2=1779580&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/10-rendererBase-getCurrentValue/rendererBase-getCurrentValue.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/10-rendererBase-getCurrentValue/rendererBase-getCurrentValue.xhtml Fri Jan 20 08:47:33 2017
@@ -19,7 +19,8 @@
<ui:composition template="/main.xhtml"
xmlns:tc="http://myfaces.apache.org/tobago/component"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html">
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
<ui:param name="title" value="Test: RendererBase.getCurrentValue()"/>
@@ -27,9 +28,14 @@
<tc:out id="outStringFromMethod" labelLayout="none" value="#{currentValueController.toUpperCase('Hello world!')}"/>
- <tc:out id="outDate" labelLayout="none" value="#{currentValueController.date}"/>
-
- <tc:out id="outDateFromMethod" labelLayout="none" value="#{currentValueController.plus50(currentValueController.date)}"/>
+ <tc:out id="outDate" labelLayout="none" value="#{currentValueController.date}">
+ <f:convertDateTime pattern="dd.MM.yyyy"/>
+ </tc:out>
+
+ <tc:out id="outDateFromMethod" labelLayout="none"
+ value="#{currentValueController.plus50(currentValueController.date)}">
+ <f:convertDateTime pattern="dd.MM.yyyy"/>
+ </tc:out>
<tc:out id="outCurrency" labelLayout="none" value="#{currentValueController.currency}"/>