diff --git a/brjs-sdk/sdk/libs/javascript/br-presenter/src/br/presenter/testing/KnockoutInvocationCountPlugin.js b/brjs-sdk/sdk/libs/javascript/br-presenter/src/br/presenter/testing/KnockoutInvocationCountPlugin.js index f544c0475..1e96f6ba9 100644 --- a/brjs-sdk/sdk/libs/javascript/br-presenter/src/br/presenter/testing/KnockoutInvocationCountPlugin.js +++ b/brjs-sdk/sdk/libs/javascript/br-presenter/src/br/presenter/testing/KnockoutInvocationCountPlugin.js @@ -68,7 +68,7 @@ KnockoutInvocationCountPlugin.prototype.update = function(eElement, fValueAccess KnockoutInvocationCountPlugin.prototype._getInvocationCountingProxyMethod = function(fOrigMethod) { var fMethod = function() { fOrigMethod.invocationCount++; - fOrigMethod.apply(this, arguments); + return fOrigMethod.apply(this, arguments); }; fOrigMethod.invocationCount = 0; return fMethod; diff --git a/brjs-sdk/sdk/libs/javascript/br-presenter/src/br/presenter/testing/PresentationModelFixture.js b/brjs-sdk/sdk/libs/javascript/br-presenter/src/br/presenter/testing/PresentationModelFixture.js index 37f408a98..554a3a3e9 100644 --- a/brjs-sdk/sdk/libs/javascript/br-presenter/src/br/presenter/testing/PresentationModelFixture.js +++ b/brjs-sdk/sdk/libs/javascript/br-presenter/src/br/presenter/testing/PresentationModelFixture.js @@ -300,7 +300,7 @@ PresentationModelFixture.InvocationCountSetter.prototype._getInvocationCountingP var fOrigMethod = this._getMethod(); var fMethod = function() { fMethod.invocationCount++; - fOrigMethod.apply(this, arguments); + return fOrigMethod.apply(this, arguments); }; fMethod.invocationCount = nInitialValue; diff --git a/brjs-sdk/sdk/libs/javascript/br-presenter/test-unit/tests/br/presenter/testing/PresentationModelFixtureTest.js b/brjs-sdk/sdk/libs/javascript/br-presenter/test-unit/tests/br/presenter/testing/PresentationModelFixtureTest.js index 9f9bf33ae..301482595 100644 --- a/brjs-sdk/sdk/libs/javascript/br-presenter/test-unit/tests/br/presenter/testing/PresentationModelFixtureTest.js +++ b/brjs-sdk/sdk/libs/javascript/br-presenter/test-unit/tests/br/presenter/testing/PresentationModelFixtureTest.js @@ -499,6 +499,23 @@ }); }; + PresentationModelFixtureTest.prototype.test_wrappedFunctionsStillReturn = function() + { + var oPresentationModelFixture = new PresentationModelFixture(); + var oPresentationModel = new PresentationModel(); + oPresentationModelFixture.setComponent({getPresentationModel:function(){return oPresentationModel;}}); + + oPresentationModel.theFunction = function() { + return "a value"; + }; + + oPresentationModelFixture.doGiven("theFunction.invocationCount", 0); + + var valueHolder = oPresentationModel.theFunction(); + + assertEquals(valueHolder, "a value"); + }; + PresentationModelFixtureTest.prototype.test_invocationCountCanBeSetToANonZeroValue = function() { var oPresentationModelFixture = new PresentationModelFixture();