@@ -6,6 +6,9 @@ import ComponentWithoutName from '~resources/components/component-without-name.v
6
6
import ComponentWithSlots from '~resources/components/component-with-slots.vue'
7
7
import ComponentWithVFor from '~resources/components/component-with-v-for.vue'
8
8
import Component from '~resources/components/component.vue'
9
+ import FunctionalComponent from '~resources/components/functional-component.vue'
10
+ import ComponentAsAClass from '~resources/components/component-as-a-class.vue'
11
+ import { functionalSFCsSupported } from '~resources/test-utils'
9
12
10
13
describe ( 'findAll' , ( ) => {
11
14
it ( 'returns an WrapperArray of elements matching tag selector passed' , ( ) => {
@@ -175,6 +178,41 @@ describe('findAll', () => {
175
178
expect ( wrapper . findAll ( ComponentWithoutName ) . length ) . to . equal ( 3 )
176
179
} )
177
180
181
+ it ( 'returns Wrapper of class component' , ( ) => {
182
+ const TestComponent = {
183
+ template : `
184
+ <div>
185
+ <component-as-a-class />
186
+ </div>
187
+ ` ,
188
+ components : {
189
+ ComponentAsAClass
190
+ }
191
+ }
192
+
193
+ const wrapper = mount ( TestComponent )
194
+ expect ( wrapper . findAll ( ComponentAsAClass ) . length ) . to . equal ( 1 )
195
+ } )
196
+
197
+ it ( 'returns Wrapper of Vue Component matching functional component' , ( ) => {
198
+ if ( ! functionalSFCsSupported ( ) ) {
199
+ return
200
+ }
201
+ const TestComponent = {
202
+ template : `
203
+ <div>
204
+ <functional-component />
205
+ </div>
206
+ ` ,
207
+ components : {
208
+ FunctionalComponent
209
+ }
210
+ }
211
+
212
+ const wrapper = mount ( TestComponent )
213
+ expect ( wrapper . findAll ( FunctionalComponent ) . length ) . to . equal ( 1 )
214
+ } )
215
+
178
216
it ( 'returns VueWrapper with length 0 if no nodes matching selector are found' , ( ) => {
179
217
const wrapper = mount ( Component )
180
218
const preArray = wrapper . findAll ( 'pre' )
0 commit comments