@@ -4,7 +4,7 @@ import { isIE9 } from 'web/util/index'
4
4
import { nextFrame } from 'web/runtime/modules/transition'
5
5
6
6
if ( ! isIE9 ) {
7
- fdescribe ( 'Transition system' , ( ) => {
7
+ describe ( 'Transition system' , ( ) => {
8
8
const duration = injectStyles ( )
9
9
10
10
let el
@@ -539,27 +539,29 @@ if (!isIE9) {
539
539
} ) . $mount ( el )
540
540
541
541
// 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' )
543
543
vm . ok = false
544
544
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' )
546
546
} ) . 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' )
548
548
} ) . 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 ( '' )
550
552
vm . ok = true
551
553
} ) . 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' )
553
555
} ) . 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' )
555
557
} ) . thenWaitFor ( duration + 10 ) . then ( ( ) => {
556
- expect ( vm . $el . children [ 0 ] . getAttribute ( 'class' ) ) . toBe ( 'test' )
558
+ expect ( vm . $el . childNodes [ 0 ] . getAttribute ( 'class' ) ) . toBe ( 'test' )
557
559
} ) . then ( done )
558
560
} )
559
561
560
562
it ( 'transition on child components' , done => {
561
563
const vm = new Vue ( {
562
- template :`
564
+ template : `
563
565
<div>
564
566
<transition>
565
567
<test v-if="ok" class="test"></test>
0 commit comments