@@ -210,23 +210,20 @@ if (_.inBrowser && !_.isIE9) {
210
210
el . __v_trans . id = 'test'
211
211
// cascaded class style
212
212
el . classList . add ( 'test' )
213
- // wait a frame before applying the transition
214
- // because doing so in the same frame won't trigger
215
- // transition
216
- setTimeout ( function ( ) {
217
- transition . apply ( el , - 1 , op , vm , cb )
218
- _ . nextTick ( function ( ) {
219
- expect ( op ) . not . toHaveBeenCalled ( )
220
- expect ( cb ) . not . toHaveBeenCalled ( )
221
- expect ( el . classList . contains ( 'test-leave' ) ) . toBe ( true )
222
- _ . on ( el , _ . transitionEndEvent , function ( ) {
223
- expect ( op ) . toHaveBeenCalled ( )
224
- expect ( cb ) . toHaveBeenCalled ( )
225
- expect ( el . classList . contains ( 'test-leave' ) ) . toBe ( false )
226
- done ( )
227
- } )
213
+ // force a layout here so the transition can be triggered
214
+ var f = el . offsetHeight
215
+ transition . apply ( el , - 1 , op , vm , cb )
216
+ _ . nextTick ( function ( ) {
217
+ expect ( op ) . not . toHaveBeenCalled ( )
218
+ expect ( cb ) . not . toHaveBeenCalled ( )
219
+ expect ( el . classList . contains ( 'test-leave' ) ) . toBe ( true )
220
+ _ . on ( el , _ . transitionEndEvent , function ( ) {
221
+ expect ( op ) . toHaveBeenCalled ( )
222
+ expect ( cb ) . toHaveBeenCalled ( )
223
+ expect ( el . classList . contains ( 'test-leave' ) ) . toBe ( false )
224
+ done ( )
228
225
} )
229
- } , 0 )
226
+ } )
230
227
} )
231
228
232
229
it ( 'animation enter' , function ( done ) {
0 commit comments