Skip to content

Commit 033efa7

Browse files
committed
ensure coverage
1 parent 78f3a7c commit 033efa7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/transition/transition.js

+1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ p.getCssTransitionType = function (className) {
214214
// firing until the page is visible again.
215215
// pageVisibility API is supported in IE10+, same as
216216
// CSS transitions.
217+
/* istanbul ignore if */
217218
if (!transitionEndEvent || (doc && doc.hidden)) {
218219
return
219220
}

test/unit/specs/transition/transition_spec.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,20 @@ if (_.inBrowser && !_.isIE9) {
289289
transition.apply(el, 1, op, vm)
290290
_.nextTick(function () {
291291
expect(el.__v_trans.typeCache['test-enter']).not.toBeUndefined()
292-
done()
292+
// for some reason window.getComputedStyle cannot be spied on in
293+
// phantomjs after the refactor...
294+
var calls = 0
295+
Object.defineProperty(el.__v_trans.typeCache, 'test-enter', {
296+
get: function () {
297+
calls++
298+
return 1
299+
}
300+
})
301+
transition.apply(el, 1, op, vm)
302+
_.nextTick(function () {
303+
expect(calls).toBe(1)
304+
done()
305+
})
293306
})
294307
})
295308

0 commit comments

Comments
 (0)