|
|
@@ -210,23 +210,20 @@ if (_.inBrowser && !_.isIE9) {
|
|
|
el.__v_trans.id = 'test'
|
|
|
// cascaded class style
|
|
|
el.classList.add('test')
|
|
|
- // wait a frame before applying the transition
|
|
|
- // because doing so in the same frame won't trigger
|
|
|
- // transition
|
|
|
- setTimeout(function () {
|
|
|
- transition.apply(el, -1, op, vm, cb)
|
|
|
- _.nextTick(function () {
|
|
|
- expect(op).not.toHaveBeenCalled()
|
|
|
- expect(cb).not.toHaveBeenCalled()
|
|
|
- expect(el.classList.contains('test-leave')).toBe(true)
|
|
|
- _.on(el, _.transitionEndEvent, function () {
|
|
|
- expect(op).toHaveBeenCalled()
|
|
|
- expect(cb).toHaveBeenCalled()
|
|
|
- expect(el.classList.contains('test-leave')).toBe(false)
|
|
|
- done()
|
|
|
- })
|
|
|
+ // force a layout here so the transition can be triggered
|
|
|
+ var f = el.offsetHeight
|
|
|
+ transition.apply(el, -1, op, vm, cb)
|
|
|
+ _.nextTick(function () {
|
|
|
+ expect(op).not.toHaveBeenCalled()
|
|
|
+ expect(cb).not.toHaveBeenCalled()
|
|
|
+ expect(el.classList.contains('test-leave')).toBe(true)
|
|
|
+ _.on(el, _.transitionEndEvent, function () {
|
|
|
+ expect(op).toHaveBeenCalled()
|
|
|
+ expect(cb).toHaveBeenCalled()
|
|
|
+ expect(el.classList.contains('test-leave')).toBe(false)
|
|
|
+ done()
|
|
|
})
|
|
|
- }, 0)
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
it('animation enter', function (done) {
|