@@ -83,24 +83,68 @@ describe('mount.slots', () => {
8383 expect ( Array . isArray ( wrapper . vm . $slots . header ) ) . to . equal ( true )
8484 } )
8585
86- it . only ( 'mounts functional component with default slot if passed component in slot object' , ( ) => {
87- const wrapper = mount ( FunctionalComponentWithSlots , { slots : { default : [ Component ] } } )
86+ it ( 'mounts functional component with default slot if passed component in slot object' , ( ) => {
87+ const wrapper = mount ( FunctionalComponentWithSlots , { slots : { default : Component } } )
8888 expect ( wrapper . contains ( Component ) ) . to . equal ( true )
8989 } )
9090
91- it . only ( 'mounts component with default slot if passed component in slot object' , ( ) => {
91+ it ( 'mounts component with default slot if passed component in slot object' , ( ) => {
9292 const wrapper = mount ( FunctionalComponentWithSlots , { slots : { default : [ Component ] } } )
9393 expect ( wrapper . contains ( Component ) ) . to . equal ( true )
9494 } )
9595
96- it . only ( 'mounts component with default slot if passed object with template prop in slot object' , ( ) => {
96+ it ( 'mounts component with default slot if passed object with template prop in slot object' , ( ) => {
9797 const compiled = compileToFunctions ( '<div id="div" />' )
9898 const wrapper = mount ( FunctionalComponentWithSlots , { slots : { default : [ compiled ] } } )
9999 expect ( wrapper . contains ( '#div' ) ) . to . equal ( true )
100100 } )
101101
102- it . only ( 'mounts component with default slot if passed string in slot object' , ( ) => {
102+ it ( 'mounts component with default slot if passed string in slot object' , ( ) => {
103103 const wrapper = mount ( FunctionalComponentWithSlots , { slots : { default : '<span />' } } )
104104 expect ( wrapper . contains ( 'span' ) ) . to . equal ( true )
105105 } )
106+
107+ it ( 'mounts component with named slot if passed string in slot object' , ( ) => {
108+ const TestComponent = {
109+ functional : true ,
110+ render ( h , ctx ) {
111+ return h ( 'div' , { } , ctx . slots ( ) . named )
112+ }
113+ }
114+ const wrapper = mount ( TestComponent , { slots : { named : Component } } )
115+ expect ( wrapper . contains ( Component ) ) . to . equal ( true )
116+ } )
117+
118+ it ( 'mounts component with named slot if passed string in slot object in array' , ( ) => {
119+ const TestComponent = {
120+ functional : true ,
121+ render ( h , ctx ) {
122+ return h ( 'div' , { } , ctx . slots ( ) . named )
123+ }
124+ }
125+ const wrapper = mount ( TestComponent , { slots : { named : [ Component ] } } )
126+ expect ( wrapper . contains ( Component ) ) . to . equal ( true )
127+ } )
128+
129+ it ( 'mounts component with named slot if passed string in slot object in array' , ( ) => {
130+ const TestComponent = {
131+ functional : true ,
132+ render ( h , ctx ) {
133+ return h ( 'div' , { } , ctx . slots ( ) . named )
134+ }
135+ }
136+ const wrapper = mount ( TestComponent , { slots : { named : '<span />' } } )
137+ expect ( wrapper . contains ( 'span' ) ) . to . equal ( true )
138+ } )
139+
140+ it ( 'mounts component with named slot if passed string in slot object in array' , ( ) => {
141+ const TestComponent = {
142+ functional : true ,
143+ render ( h , ctx ) {
144+ return h ( 'div' , { } , ctx . slots ( ) . named )
145+ }
146+ }
147+ const wrapper = mount ( TestComponent , { slots : { named : [ '<span />' ] } } )
148+ expect ( wrapper . contains ( 'span' ) ) . to . equal ( true )
149+ } )
106150} )
0 commit comments