You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2013/06/18 10:09:37 UTC

[13/21] git commit: Rework CDI conversation test to use Promise pipe

Rework CDI conversation test to use Promise pipe


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/72837f05
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/72837f05
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/72837f05

Branch: refs/heads/master
Commit: 72837f05a10394fd3a04ca694b3347973176db9c
Parents: aa9a185
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Jun 18 08:19:57 2013 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Jun 18 08:19:57 2013 +0200

----------------------------------------------------------------------
 .../webapp/js-test/tests/cdi/conversation.js    | 44 ++++++++++----------
 1 file changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/72837f05/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js b/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js
index 36a4b99..764824e 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js
@@ -32,41 +32,41 @@ $q(document).ready(function() {
 
 	asyncTest('conversation', function () {
 		expect(4);
+		var initialValue;
 
 		gym.load('/cdi/conversation').then(function($) {
 
-			var initialValue = $(countSelector).text();
+			initialValue = $(countSelector).text();
 			initialValue = parseInt(initialValue, 10);
 
-			increment($).then(function($$) {
+			return increment($);
+		}).then(function($) {
 
-				var counterLabelValue = $$(countSelector).text();
-				var expectedValue = initialValue + 1;
-				equal(counterLabelValue, "" + expectedValue, 'The new value of the counter is +1');
+			var counterLabelValue = $(countSelector).text();
+			var expectedValue = initialValue + 1;
+			equal(counterLabelValue, "" + expectedValue, 'The new value of the counter is +1');
 
-				nextPage($$).then(function($$$) {
+			return nextPage($);
+		}).then(function($) {
 
-					counterLabelValue = $$$(countSelector).text();
-					expectedValue = initialValue + 1;
-					equal(counterLabelValue, "" + expectedValue, 'The value of the counter is the same as in the previous page');
+			var counterLabelValue = $(countSelector).text();
+			var expectedValue = initialValue + 1;
+			equal(counterLabelValue, "" + expectedValue, 'The value of the counter is the same as in the previous page');
 
-					increment($$$).then(function($$$$) {
+			return increment($);
+		}).then(function($) {
 
-						var counterLabelValue = $$$$(countSelector).text();
-						var expectedValue = initialValue + 2;
-						equal(counterLabelValue, "" + expectedValue, 'The new value of the counter is +2');
+			var counterLabelValue = $(countSelector).text();
+			var expectedValue = initialValue + 2;
+			equal(counterLabelValue, "" + expectedValue, 'The new value of the counter is +2');
 
-						nextPage($$$$).then(function($$$$$) {
+			return nextPage($);
+		}).then(function($) {
 
-							counterLabelValue = $$$$$(countSelector).text();
-							equal(counterLabelValue, "0", 'The value of the counter is 0 (no conversation)');
+			var counterLabelValue = $(countSelector).text();
+			equal(counterLabelValue, "0", 'The value of the counter is 0 (no conversation)');
 
-							start();
-						});
-					});
-				});
-			});
-		});
+		}).always(start);
 	});
 
 });
\ No newline at end of file