File tree 1 file changed +11
-1
lines changed
dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,16 @@ define([
74
74
originalReload = obj . reload ;
75
75
originalInitNamespaceStorage = $ . initNamespaceStorage ;
76
76
spyOn ( obj , 'reload' ) . and . returnValue ( true ) ;
77
- spyOn ( $ , 'initNamespaceStorage' ) . and . returnValue ( true ) ;
77
+ spyOn ( $ , 'initNamespaceStorage' ) . and . callFake ( function ( name ) {
78
+ let ns = {
79
+ localStorage : { cookie : false , _ns : name } ,
80
+ sessionStorage : { cookie : false , _ns : name }
81
+ } ;
82
+
83
+ $ . namespaceStorages [ name ] = ns ;
84
+
85
+ return ns ;
86
+ } ) ;
78
87
spyOn ( dataProvider , 'getFromStorage' ) ;
79
88
spyOn ( storage , 'keys' ) . and . returnValue ( [ 'section' ] ) ;
80
89
spyOn ( storageInvalidation , 'keys' ) . and . returnValue ( [ 'section' ] ) ;
@@ -83,6 +92,7 @@ define([
83
92
afterEach ( function ( ) {
84
93
obj . reload = originalReload ;
85
94
$ . initNameSpaceStorage = originalInitNamespaceStorage ;
95
+ $ . namespaceStorages = { } ;
86
96
} ) ;
87
97
88
98
it ( 'Should be defined' , function ( ) {
You can’t perform that action at this time.
0 commit comments