WICKET-5306 Dynamic extra paramaters not evaluated in ajax submitting behavior in a multipart form
Add unit tests that dynamic extra parameters are calculated for multipart form submits Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/7d22d55d Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/7d22d55d Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/7d22d55d Branch: refs/heads/5299-ajax-strategy Commit: 7d22d55d77abbcc853ea93c0baf86df1c1fb333c Parents: ad53a1b Author: Martin Tzvetanov Grigorov <mgrigo...@apache.org> Authored: Wed Aug 7 11:04:17 2013 +0200 Committer: Martin Tzvetanov Grigorov <mgrigo...@apache.org> Committed: Wed Aug 7 11:04:17 2013 +0200 ---------------------------------------------------------------------- wicket-core/src/test/js/ajax.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/7d22d55d/wicket-core/src/test/js/ajax.js ---------------------------------------------------------------------- diff --git a/wicket-core/src/test/js/ajax.js b/wicket-core/src/test/js/ajax.js index da30d7e..d370de8 100644 --- a/wicket-core/src/test/js/ajax.js +++ b/wicket-core/src/test/js/ajax.js @@ -990,7 +990,7 @@ jQuery(document).ready(function() { */ asyncTest('Submit nested form - success scenario.', function () { - expect(8); + expect(9); var attrs = { f: "innerForm", // the id of the form to submit @@ -1012,6 +1012,13 @@ jQuery(document).ready(function() { equal(attrs.event.isDefaultPrevented(), false, "default behavior is allowed"); } ] + , + dep: [ + function(attrs) { + ok(true, "Dynamic parameters are collected in success scenario!"); + return { 'one': 1 }; + } + ] }; Wicket.Ajax.ajax(attrs); @@ -1026,7 +1033,7 @@ jQuery(document).ready(function() { */ asyncTest('Submit nested form - failure scenario.', function () { - expect(7); + expect(8); var attrs = { f: "innerForm", // the id of the form to submit @@ -1047,6 +1054,12 @@ jQuery(document).ready(function() { ok(true, "Complete handler executed"); equal(attrs.event.isDefaultPrevented(), false, "default behavior is not prevented"); } + ], + dep: [ + function(attrs) { + ok(true, "Dynamic parameters are collected in failure scenario!"); + return { 'one': 1 }; + } ] };