@@ -2,7 +2,9 @@ import { mount, config } from '~vue-test-utils'
2
2
import ComponentWithChild from '~resources/components/component-with-child.vue'
3
3
import ComponentWithNestedChildren from '~resources/components/component-with-nested-children.vue'
4
4
import Component from '~resources/components/component.vue'
5
+ import ComponentAsAClass from '~resources/components/component-as-a-class.vue'
5
6
import { createLocalVue } from '~vue-test-utils'
7
+ import Vue from 'vue'
6
8
7
9
describe ( 'mount.stub' , ( ) => {
8
10
let info
@@ -22,6 +24,20 @@ describe('mount.stub', () => {
22
24
config . stubs = configStubsSave
23
25
} )
24
26
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
+
25
41
it ( 'replaces component with template string ' , ( ) => {
26
42
const wrapper = mount ( ComponentWithChild , {
27
43
stubs : {
0 commit comments