Skip to content

Commit bcb8944

Browse files
committed
make tests pass on Chrome 37.0 Android
1 parent efb335d commit bcb8944

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

test/unit/specs/transition_spec.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,22 @@ if (_.inBrowser && !_.isIE9) {
200200
el.__v_trans.id = 'test'
201201
// cascaded class style
202202
el.classList.add('test')
203-
transition.apply(el, -1, op, vm, cb)
204-
expect(op).not.toHaveBeenCalled()
205-
expect(cb).not.toHaveBeenCalled()
206-
expect(el.classList.contains('test-leave')).toBe(false)
203+
// wait a frame: Chrome Android 37 doesn't trigger
204+
// transition if we apply the leave class in the
205+
// same frame.
207206
_.nextTick(function () {
208-
expect(el.classList.contains('test-leave')).toBe(true)
209-
_.on(el, _.transitionEndEvent, function () {
210-
expect(op).toHaveBeenCalled()
211-
expect(cb).toHaveBeenCalled()
212-
expect(el.classList.contains('test-leave')).toBe(false)
213-
done()
207+
transition.apply(el, -1, op, vm, cb)
208+
expect(op).not.toHaveBeenCalled()
209+
expect(cb).not.toHaveBeenCalled()
210+
expect(el.classList.contains('test-leave')).toBe(false)
211+
_.nextTick(function () {
212+
expect(el.classList.contains('test-leave')).toBe(true)
213+
_.on(el, _.transitionEndEvent, function () {
214+
expect(op).toHaveBeenCalled()
215+
expect(cb).toHaveBeenCalled()
216+
expect(el.classList.contains('test-leave')).toBe(false)
217+
done()
218+
})
214219
})
215220
})
216221
})

0 commit comments

Comments
 (0)