@@ -27,7 +27,7 @@ describe('AppsecFsPlugin', () => {
27
27
beforeEach ( ( ) => {
28
28
configure = sinon . stub ( )
29
29
class PluginClass {
30
- addSub ( channelName , handler ) { }
30
+ addBind ( channelName , handler ) { }
31
31
32
32
configure ( config ) {
33
33
configure ( config )
@@ -93,20 +93,18 @@ describe('AppsecFsPlugin', () => {
93
93
} )
94
94
95
95
describe ( '_onFsOperationStart' , ( ) => {
96
- it ( 'should mark fs root' , ( ) => {
96
+ it ( 'should return fs root' , ( ) => {
97
97
const origStore = { }
98
98
storage ( 'legacy' ) . enterWith ( origStore )
99
99
100
- appsecFsPlugin . _onFsOperationStart ( )
100
+ let store = appsecFsPlugin . _onFsOperationStart ( )
101
101
102
- let store = storage ( 'legacy' ) . getStore ( )
103
102
assert . property ( store , 'fs' )
104
103
assert . propertyVal ( store . fs , 'parentStore' , origStore )
105
104
assert . propertyVal ( store . fs , 'root' , true )
106
105
107
- appsecFsPlugin . _onFsOperationFinishOrRenderEnd ( )
106
+ store = appsecFsPlugin . _onFsOperationFinishOrRenderEnd ( )
108
107
109
- store = storage ( 'legacy' ) . getStore ( )
110
108
assert . equal ( store , origStore )
111
109
assert . notProperty ( store , 'fs' )
112
110
} )
@@ -115,28 +113,30 @@ describe('AppsecFsPlugin', () => {
115
113
const origStore = { orig : true }
116
114
storage ( 'legacy' ) . enterWith ( origStore )
117
115
118
- appsecFsPlugin . _onFsOperationStart ( )
116
+ const rootStore = appsecFsPlugin . _onFsOperationStart ( )
119
117
120
- const rootStore = storage ( 'legacy' ) . getStore ( )
121
118
assert . property ( rootStore , 'fs' )
122
119
assert . propertyVal ( rootStore . fs , 'parentStore' , origStore )
123
120
assert . propertyVal ( rootStore . fs , 'root' , true )
124
121
125
- appsecFsPlugin . _onFsOperationStart ( )
122
+ storage ( 'legacy' ) . enterWith ( rootStore )
123
+
124
+ let store = appsecFsPlugin . _onFsOperationStart ( )
126
125
127
- let store = storage ( 'legacy' ) . getStore ( )
128
126
assert . property ( store , 'fs' )
129
127
assert . propertyVal ( store . fs , 'parentStore' , rootStore )
130
128
assert . propertyVal ( store . fs , 'root' , false )
131
129
assert . propertyVal ( store , 'orig' , true )
132
130
133
- appsecFsPlugin . _onFsOperationFinishOrRenderEnd ( )
131
+ storage ( 'legacy' ) . enterWith ( store )
132
+
133
+ store = appsecFsPlugin . _onFsOperationFinishOrRenderEnd ( )
134
134
135
- store = storage ( 'legacy' ) . getStore ( )
136
135
assert . equal ( store , rootStore )
137
136
138
- appsecFsPlugin . _onFsOperationFinishOrRenderEnd ( )
139
- store = storage ( 'legacy' ) . getStore ( )
137
+ storage ( 'legacy' ) . enterWith ( store )
138
+
139
+ store = appsecFsPlugin . _onFsOperationFinishOrRenderEnd ( )
140
140
assert . equal ( store , origStore )
141
141
} )
142
142
} )
@@ -148,16 +148,16 @@ describe('AppsecFsPlugin', () => {
148
148
const origStore = { }
149
149
storage ( 'legacy' ) . enterWith ( origStore )
150
150
151
- appsecFsPlugin . _onResponseRenderStart ( )
151
+ let store = appsecFsPlugin . _onResponseRenderStart ( )
152
152
153
- let store = storage ( 'legacy' ) . getStore ( )
154
153
assert . property ( store , 'fs' )
155
154
assert . propertyVal ( store . fs , 'parentStore' , origStore )
156
155
assert . propertyVal ( store . fs , 'opExcluded' , true )
157
156
158
- appsecFsPlugin . _onFsOperationFinishOrRenderEnd ( )
157
+ storage ( 'legacy' ) . enterWith ( store )
158
+
159
+ store = appsecFsPlugin . _onFsOperationFinishOrRenderEnd ( )
159
160
160
- store = storage ( 'legacy' ) . getStore ( )
161
161
assert . equal ( store , origStore )
162
162
assert . notProperty ( store , 'fs' )
163
163
} )
0 commit comments