@@ -83,24 +83,68 @@ describe('mount.slots', () => {
83
83
expect ( Array . isArray ( wrapper . vm . $slots . header ) ) . to . equal ( true )
84
84
} )
85
85
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 } } )
88
88
expect ( wrapper . contains ( Component ) ) . to . equal ( true )
89
89
} )
90
90
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' , ( ) => {
92
92
const wrapper = mount ( FunctionalComponentWithSlots , { slots : { default : [ Component ] } } )
93
93
expect ( wrapper . contains ( Component ) ) . to . equal ( true )
94
94
} )
95
95
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' , ( ) => {
97
97
const compiled = compileToFunctions ( '<div id="div" />' )
98
98
const wrapper = mount ( FunctionalComponentWithSlots , { slots : { default : [ compiled ] } } )
99
99
expect ( wrapper . contains ( '#div' ) ) . to . equal ( true )
100
100
} )
101
101
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' , ( ) => {
103
103
const wrapper = mount ( FunctionalComponentWithSlots , { slots : { default : '<span />' } } )
104
104
expect ( wrapper . contains ( 'span' ) ) . to . equal ( true )
105
105
} )
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
+ } )
106
150
} )
0 commit comments