@@ -2,7 +2,9 @@ import { mount, config } from '~vue-test-utils'
22import ComponentWithChild from '~resources/components/component-with-child.vue'
33import ComponentWithNestedChildren from '~resources/components/component-with-nested-children.vue'
44import Component from '~resources/components/component.vue'
5+ import ComponentAsAClass from '~resources/components/component-as-a-class.vue'
56import { createLocalVue } from '~vue-test-utils'
7+ import Vue from 'vue'
68
79describe ( 'mount.stub' , ( ) => {
810 let info
@@ -22,6 +24,20 @@ describe('mount.stub', () => {
2224 config . stubs = configStubsSave
2325 } )
2426
27+ it ( 'accepts valid component stubs' , ( ) => {
28+ const ComponentWithRender = { render : h => h ( 'div' ) }
29+ const ComponentWithoutRender = { template : '<div></div>' }
30+ const ExtendedComponent = Vue . extend ( { template : '<div></div>' } )
31+ mount ( ComponentWithChild , {
32+ stubs : {
33+ ChildComponent : ComponentAsAClass ,
34+ ChildComponent2 : ComponentWithRender ,
35+ ChildComponent3 : ComponentWithoutRender ,
36+ ChildComponent4 : ExtendedComponent
37+ }
38+ } )
39+ } )
40+
2541 it ( 'replaces component with template string ' , ( ) => {
2642 const wrapper = mount ( ComponentWithChild , {
2743 stubs : {
0 commit comments