@@ -6,6 +6,9 @@ import ComponentWithoutName from '~resources/components/component-without-name.v
66import ComponentWithSlots from '~resources/components/component-with-slots.vue'
77import ComponentWithVFor from '~resources/components/component-with-v-for.vue'
88import 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'
912
1013describe ( 'findAll' , ( ) => {
1114 it ( 'returns an WrapperArray of elements matching tag selector passed' , ( ) => {
@@ -175,6 +178,41 @@ describe('findAll', () => {
175178 expect ( wrapper . findAll ( ComponentWithoutName ) . length ) . to . equal ( 3 )
176179 } )
177180
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+
178216 it ( 'returns VueWrapper with length 0 if no nodes matching selector are found' , ( ) => {
179217 const wrapper = mount ( Component )
180218 const preArray = wrapper . findAll ( 'pre' )
0 commit comments