From fed2b03cc657dc3ed40dca782ed08beee647c494 Mon Sep 17 00:00:00 2001 From: antikalk Date: Thu, 21 May 2020 22:41:49 +0200 Subject: [PATCH] Revert "+ dont manipulate response data" This reverts commit bfc6ba2008db02c3683933dd8c420cab3f963f3c. --- test/e2e-specs.js | 2 +- test/js-specs.js | 6 +++--- www/helpers.js | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/e2e-specs.js b/test/e2e-specs.js index 8ff248c..b3691c3 100644 --- a/test/e2e-specs.js +++ b/test/e2e-specs.js @@ -898,7 +898,7 @@ const tests = [ }, resolve, reject); }, validationFunc: function (driver, result) { result.type.should.be.equal('resolved'); - should.equal('', result.data.data); + should.equal(null, result.data.data); } }, { diff --git a/test/js-specs.js b/test/js-specs.js index b8710a9..253841e 100644 --- a/test/js-specs.js +++ b/test/js-specs.js @@ -449,7 +449,7 @@ describe('Common helpers', function () { const helpers = require('../www/helpers')(null, jsUtil, null, messages, null, errorCodes); const handler = helpers.injectRawResponseHandler( 'json', - response => should.equal('', response.data) + response => should.equal(null, response.data) ); handler({ data: emptyData }); @@ -469,7 +469,7 @@ describe('Common helpers', function () { const helpers = require('../www/helpers')(null, jsUtil, null, messages, fakeBase64, errorCodes); const handler = helpers.injectRawResponseHandler( 'arraybuffer', - response => should.equal('', response.data) + response => should.equal(null, response.data) ); handler({ data: '' }); @@ -494,7 +494,7 @@ describe('Common helpers', function () { const handler = helpers.injectRawResponseHandler( 'blob', (response) => { - should.equal('', response.data) + should.equal(null, response.data) } ); diff --git a/www/helpers.js b/www/helpers.js index c930e67..66e20aa 100644 --- a/www/helpers.js +++ b/www/helpers.js @@ -293,6 +293,8 @@ module.exports = function init(global, jsUtil, cookieHandler, messages, base64, } if (!response.data) { + // return null as data if response data is not set + response.data = null; return success(response); }