File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -98,4 +98,21 @@ describe('html', () => {
98
98
const foo = wrapper . findComponent ( Foo )
99
99
expect ( foo . html ( ) ) . toEqual ( '<div class="Foo">FOO</div>' )
100
100
} )
101
+
102
+ it ( 'get component from within root fragments' , ( ) => {
103
+ const RegularComponent = {
104
+ name : 'RegularComponent' ,
105
+ template : '<span>hello world</span>'
106
+ }
107
+ const ComponentWithRootFragments = {
108
+ name : 'ComponentWithRootFragments' ,
109
+ template : '<regular-component /><div>bye bye</div>' ,
110
+ components : { RegularComponent }
111
+ }
112
+ const wrapper = mount ( ComponentWithRootFragments )
113
+ const regular = wrapper . getComponent ( RegularComponent )
114
+
115
+ expect ( regular . vm . $options . name ) . toBe ( 'RegularComponent' )
116
+ expect ( regular . html ( ) ) . toMatchInlineSnapshot ( `"<span>hello world</span>"` )
117
+ } )
101
118
} )
You can’t perform that action at this time.
0 commit comments