File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1- import { createLocalVue } from '~vue/test-utils'
1+ import { createLocalVue , createWrapper } from '~vue/test-utils'
22import { describeWithShallowAndMount , vueVersion } from '~resources/utils'
33import { itDoNotRunIf } from 'conditional-specs'
44import Vue from 'vue'
@@ -158,4 +158,14 @@ describeWithShallowAndMount('emitted', mountingMethod => {
158158
159159 expect ( wrapper . find ( { name : 'bar' } ) . emitted ( 'foo' ) ) . to . exist
160160 } )
161+
162+ it ( 'captures emitted events on $root instance' , ( ) => {
163+ const wrapper = mountingMethod ( {
164+ render : h => h ( 'div' )
165+ } )
166+
167+ wrapper . vm . $root . $emit ( 'foo' )
168+ const rootWrapper = createWrapper ( wrapper . vm . $root )
169+ expect ( rootWrapper . emitted ( 'foo' ) ) . to . exist
170+ } )
161171} )
You can’t perform that action at this time.
0 commit comments