@@ -61,9 +61,9 @@ describe('Component slot', () => {
6161 ` ,
6262 parentContent : '<p slot="b">slot b</p>'
6363 } )
64- expect ( child . $el . childNodes . length ) . toBe ( 2 )
65- expect ( child . $el . firstChild . textContent ) . toBe ( 'fallback a' )
66- expect ( child . $el . lastChild . textContent ) . toBe ( 'slot b' )
64+ expect ( child . $el . children . length ) . toBe ( 2 )
65+ expect ( child . $el . children [ 0 ] . textContent ) . toBe ( 'fallback a' )
66+ expect ( child . $el . children [ 1 ] . textContent ) . toBe ( 'slot b' )
6767 } )
6868
6969 it ( 'fallback content with mixed named/unamed slots' , ( ) => {
@@ -76,9 +76,9 @@ describe('Component slot', () => {
7676 ` ,
7777 parentContent : '<p slot="b">slot b</p>'
7878 } )
79- expect ( child . $el . childNodes . length ) . toBe ( 2 )
80- expect ( child . $el . firstChild . textContent ) . toBe ( 'fallback a' )
81- expect ( child . $el . lastChild . textContent ) . toBe ( 'slot b' )
79+ expect ( child . $el . children . length ) . toBe ( 2 )
80+ expect ( child . $el . children [ 0 ] . textContent ) . toBe ( 'fallback a' )
81+ expect ( child . $el . children [ 1 ] . textContent ) . toBe ( 'slot b' )
8282 } )
8383
8484 it ( 'selector matching multiple elements' , ( ) => {
@@ -100,16 +100,16 @@ describe('Component slot', () => {
100100 ` ,
101101 parentContent : '<div>foo</div><p slot="a">1</p><p slot="b">2</p>'
102102 } )
103- expect ( child . $el . innerHTML ) . toBe ( '<p>1</p><div>foo</div><p>2</p>' )
103+ expect ( child . $el . innerHTML ) . toBe ( '<p>1</p> <div>foo</div> <p>2</p>' )
104104 } )
105105
106106 it ( 'name should only match children' , function ( ) {
107107 mount ( {
108108 childTemplate : `
109109 <div>
110110 <slot name="a"><p>fallback a</p></slot>
111- <slot name="b">fallback b</slot>
112- <slot name="c">fallback c</slot>
111+ <slot name="b"><p> fallback b</p> </slot>
112+ <slot name="c"><p> fallback c</p> </slot>
113113 </div>
114114 ` ,
115115 parentContent : `
@@ -118,10 +118,10 @@ describe('Component slot', () => {
118118 '<span><p slot="c">nested c</p></span>
119119 `
120120 } )
121- expect ( child . $el . childNodes . length ) . toBe ( 3 )
122- expect ( child . $el . firstChild . textContent ) . toBe ( 'fallback a' )
123- expect ( child . $el . childNodes [ 1 ] . textContent ) . toBe ( 'select b' )
124- expect ( child . $el . lastChild . textContent ) . toBe ( 'fallback c' )
121+ expect ( child . $el . children . length ) . toBe ( 3 )
122+ expect ( child . $el . children [ 0 ] . textContent ) . toBe ( 'fallback a' )
123+ expect ( child . $el . children [ 1 ] . textContent ) . toBe ( 'select b' )
124+ expect ( child . $el . children [ 2 ] . textContent ) . toBe ( 'fallback c' )
125125 } )
126126
127127 it ( 'should accept expressions in slot attribute and slot names' , ( ) => {
0 commit comments