From 2922c1c293e41fa1d056d868c816b6f0f2e5c160 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Fri, 14 Aug 2020 18:56:47 +0300 Subject: [PATCH] Fix failing unit test --- .../frontend/js/customer-data.test.js | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/customer-data.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/customer-data.test.js index e2caa08617ef2..20be2cae41be5 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/customer-data.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/customer-data.test.js @@ -16,7 +16,6 @@ define([ sectionConfig, originalGetJSON, originalReload, - originalInitNamespaceStorage, originalEach, obj; @@ -72,24 +71,12 @@ define([ beforeEach(function () { originalReload = obj.reload; - originalInitNamespaceStorage = $.initNamespaceStorage; spyOn(obj, 'reload').and.returnValue(true); - spyOn($, 'initNamespaceStorage').and.callFake(function (name) { - var ns = { - localStorage: { - cookie: false, - _ns: name - }, - sessionStorage: { - cookie: false, - _ns: name - } - }; - $.namespaceStorages[name] = ns; + //Init storage api library + $.initNamespaceStorage('mage-cache-storage').localStorage; + $.initNamespaceStorage('mage-cache-storage-section-invalidation').localStorage; - return ns; - }); spyOn(dataProvider, 'getFromStorage'); spyOn(storage, 'keys').and.returnValue(['section']); spyOn(storageInvalidation, 'keys').and.returnValue(['section']); @@ -97,7 +84,6 @@ define([ afterEach(function () { obj.reload = originalReload; - $.initNameSpaceStorage = originalInitNamespaceStorage; $.namespaceStorages = {}; });