File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,9 @@ describe('ConnectedRouter', () => {
166
166
} ,
167
167
action : 'PUSH' ,
168
168
}
169
- } )
169
+ } )
170
+
171
+ expect ( props . history . entries ) . toHaveLength ( 3 )
170
172
171
173
store . dispatch ( {
172
174
type : LOCATION_CHANGE ,
@@ -179,8 +181,10 @@ describe('ConnectedRouter', () => {
179
181
} ,
180
182
action : 'PUSH' ,
181
183
}
182
- } )
183
-
184
+ } )
185
+
186
+ expect ( props . history . entries ) . toHaveLength ( 3 )
187
+
184
188
store . dispatch ( {
185
189
type : LOCATION_CHANGE ,
186
190
payload : {
@@ -208,8 +212,11 @@ describe('ConnectedRouter', () => {
208
212
mount (
209
213
< Provider store = { store } >
210
214
< ConnectedRouter
211
- stateCompareFunction = { ( ) => true }
212
- { ...props } >
215
+ stateCompareFunction = { ( a , b ) => {
216
+ return a === undefined || ( a . foo === "baz" && b . foo === 'bar' ) ? true : false
217
+ } }
218
+ { ...props }
219
+ >
213
220
< Route path = "/" render = { ( ) => < div > Home</ div > } />
214
221
</ ConnectedRouter >
215
222
</ Provider >
@@ -229,7 +236,9 @@ describe('ConnectedRouter', () => {
229
236
} ,
230
237
action : 'PUSH' ,
231
238
}
232
- } )
239
+ } )
240
+
241
+ expect ( props . history . entries ) . toHaveLength ( 3 )
233
242
234
243
store . dispatch ( {
235
244
type : LOCATION_CHANGE ,
@@ -244,7 +253,7 @@ describe('ConnectedRouter', () => {
244
253
}
245
254
} )
246
255
247
- expect ( props . history . entries ) . toHaveLength ( 2 )
256
+ expect ( props . history . entries ) . toHaveLength ( 3 )
248
257
} )
249
258
250
259
it ( 'only renders one time when mounted' , ( ) => {
You can’t perform that action at this time.
0 commit comments