@@ -58,7 +58,7 @@ describe('Given the SizeMe library', () => {
58
58
beforeEach ( ( ) => {
59
59
resizeDetectorMock = {
60
60
// :: domEl -> void
61
- removeAllListeners : jest . fn ( ) ,
61
+ uninstall : jest . fn ( ) ,
62
62
// :: (domeEl, callback) -> void
63
63
listenTo : jest . fn ( ) ,
64
64
}
@@ -160,12 +160,12 @@ describe('Given the SizeMe library', () => {
160
160
const mounted = mount ( < SizeAwareComponent /> )
161
161
162
162
expect ( resizeDetectorMock . listenTo ) . toHaveBeenCalledTimes ( 1 )
163
- expect ( resizeDetectorMock . removeAllListeners ) . toHaveBeenCalledTimes ( 0 )
163
+ expect ( resizeDetectorMock . uninstall ) . toHaveBeenCalledTimes ( 0 )
164
164
165
165
mounted . unmount ( )
166
166
167
167
expect ( resizeDetectorMock . listenTo ) . toHaveBeenCalledTimes ( 1 )
168
- expect ( resizeDetectorMock . removeAllListeners ) . toHaveBeenCalledTimes ( 1 )
168
+ expect ( resizeDetectorMock . uninstall ) . toHaveBeenCalledTimes ( 1 )
169
169
} )
170
170
} )
171
171
@@ -212,7 +212,7 @@ describe('Given the SizeMe library', () => {
212
212
213
213
// An add listener should have been called for the placeholder.
214
214
expect ( resizeDetectorMock . listenTo ) . toHaveBeenCalledTimes ( 1 )
215
- expect ( resizeDetectorMock . removeAllListeners ) . toHaveBeenCalledTimes ( 0 )
215
+ expect ( resizeDetectorMock . uninstall ) . toHaveBeenCalledTimes ( 0 )
216
216
217
217
// Get the callback for size changes.
218
218
const checkIfSizeChangedCallback =
@@ -229,14 +229,14 @@ describe('Given the SizeMe library', () => {
229
229
// on the newly mounted component.
230
230
expect ( mounted . text ( ) ) . toEqual ( expected ( { width : 100 , height : 50 } ) )
231
231
expect ( resizeDetectorMock . listenTo ) . toHaveBeenCalledTimes ( 2 )
232
- expect ( resizeDetectorMock . removeAllListeners ) . toHaveBeenCalledTimes ( 1 )
232
+ expect ( resizeDetectorMock . uninstall ) . toHaveBeenCalledTimes ( 1 )
233
233
234
234
// umount
235
235
mounted . unmount ( )
236
236
237
237
// The remove listener should have been called!
238
238
expect ( resizeDetectorMock . listenTo ) . toHaveBeenCalledTimes ( 2 )
239
- expect ( resizeDetectorMock . removeAllListeners ) . toHaveBeenCalledTimes ( 2 )
239
+ expect ( resizeDetectorMock . uninstall ) . toHaveBeenCalledTimes ( 2 )
240
240
} )
241
241
} )
242
242
0 commit comments