@@ -63,6 +63,44 @@ describeRunIf(process.env.TEST_ENV !== 'node', 'shallowMount', () => {
63
63
expect ( console . info . callCount ) . to . equal ( 4 )
64
64
} )
65
65
66
+ it ( 'renders children' , ( ) => {
67
+ const localVue = createLocalVue ( )
68
+ localVue . component ( 'child' , {
69
+ template : '<div />'
70
+ } )
71
+ const TestComponent = {
72
+ template : `<child>{{'Hello'}}</child>`
73
+ }
74
+ const wrapper = shallowMount ( TestComponent , {
75
+ localVue
76
+ } )
77
+ expect ( wrapper . html ( ) ) . to . equal ( '<child-stub>Hello</child-stub>' )
78
+ } )
79
+
80
+ it ( 'renders no children if none supplied' , ( ) => {
81
+ const TestComponent = {
82
+ template : '<child />' ,
83
+ components : { Child : { } }
84
+ }
85
+ const wrapper = shallowMount ( TestComponent )
86
+ expect ( wrapper . html ( ) ) . to . equal ( '<child-stub></child-stub>' )
87
+ } )
88
+
89
+ it ( 'renders children for functional components' , ( ) => {
90
+ const localVue = createLocalVue ( )
91
+ localVue . component ( 'child' , {
92
+ template : '<div />' ,
93
+ functional : true
94
+ } )
95
+ const TestComponent = {
96
+ template : `<child>{{'Hello'}}</child>`
97
+ }
98
+ const wrapper = shallowMount ( TestComponent , {
99
+ localVue
100
+ } )
101
+ expect ( wrapper . html ( ) ) . to . equal ( '<child-stub>Hello</child-stub>' )
102
+ } )
103
+
66
104
it ( 'stubs globally registered components' , ( ) => {
67
105
Vue . component ( 'registered-component' , ComponentWithLifecycleHooks )
68
106
const Component = {
0 commit comments