Skip to content

Commit

Permalink
Fix js unit test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-sviziev authored Aug 14, 2020
1 parent dd862a2 commit cdfc681
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,16 @@ define([
originalReload = obj.reload;
originalInitNamespaceStorage = $.initNamespaceStorage;
spyOn(obj, 'reload').and.returnValue(true);
spyOn($, 'initNamespaceStorage').and.returnValue(true);
spyOn($, 'initNamespaceStorage').and.callFake(function (name) {
let ns = {
localStorage: {cookie: false, _ns: name},
sessionStorage: {cookie: false, _ns: name}
};

$.namespaceStorages[name] = ns;

return ns;
});
spyOn(dataProvider, 'getFromStorage');
spyOn(storage, 'keys').and.returnValue(['section']);
spyOn(storageInvalidation, 'keys').and.returnValue(['section']);
Expand All @@ -83,6 +92,7 @@ define([
afterEach(function () {
obj.reload = originalReload;
$.initNameSpaceStorage = originalInitNamespaceStorage;
$.namespaceStorages={};
});

it('Should be defined', function () {
Expand Down

0 comments on commit cdfc681

Please sign in to comment.