Skip to content

Commit 6672481

Browse files
committed
fix transition test in phantomjs
1 parent e94ad14 commit 6672481

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

test/unit/features/transition/transition.spec.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { isIE9 } from 'web/util/index'
44
import { nextFrame } from 'web/runtime/modules/transition'
55

66
if (!isIE9) {
7-
fdescribe('Transition system', () => {
7+
describe('Transition system', () => {
88
const duration = injectStyles()
99

1010
let el
@@ -539,27 +539,29 @@ if (!isIE9) {
539539
}).$mount(el)
540540

541541
// should not apply transition on initial render by default
542-
expect(vm.$el.children[0].getAttribute('class')).toBe('test')
542+
expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test')
543543
vm.ok = false
544544
waitForUpdate(() => {
545-
expect(vm.$el.children[0].getAttribute('class')).toBe('test v-leave v-leave-active')
545+
expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test v-leave v-leave-active')
546546
}).thenWaitFor(nextFrame).then(() => {
547-
expect(vm.$el.children[0].getAttribute('class')).toBe('test v-leave-active')
547+
expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test v-leave-active')
548548
}).thenWaitFor(duration + 10).then(() => {
549-
expect(vm.$el.children.length).toBe(0)
549+
expect(vm.$el.childNodes.length).toBe(1)
550+
expect(vm.$el.childNodes[0].nodeType).toBe(3) // should be an empty text node
551+
expect(vm.$el.childNodes[0].textContent).toBe('')
550552
vm.ok = true
551553
}).then(() => {
552-
expect(vm.$el.children[0].getAttribute('class')).toBe('test v-enter v-enter-active')
554+
expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test v-enter v-enter-active')
553555
}).thenWaitFor(nextFrame).then(() => {
554-
expect(vm.$el.children[0].getAttribute('class')).toBe('test v-enter-active')
556+
expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test v-enter-active')
555557
}).thenWaitFor(duration + 10).then(() => {
556-
expect(vm.$el.children[0].getAttribute('class')).toBe('test')
558+
expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test')
557559
}).then(done)
558560
})
559561

560562
it('transition on child components', done => {
561563
const vm = new Vue({
562-
template:`
564+
template: `
563565
<div>
564566
<transition>
565567
<test v-if="ok" class="test"></test>

0 commit comments

Comments
 (0)