@@ -37,36 +37,36 @@ describeWithMountingMethods('options.localVue', (mountingMethod) => {
3737 itSkipIf (
3838 vueVersion < 2.3 ,
3939 'works correctly with extended children' , ( ) => {
40- const localVue = createLocalVue ( )
41- localVue . use ( Vuex )
42- const store = new Vuex . Store ( {
43- state : { val : 2 }
44- } )
45- const ChildComponent = Vue . extend ( {
46- template : '<span>{{val}}</span>' ,
47- computed : {
48- val ( ) {
49- return this . $store . state . val
40+ const localVue = createLocalVue ( )
41+ localVue . use ( Vuex )
42+ const store = new Vuex . Store ( {
43+ state : { val : 2 }
44+ } )
45+ const ChildComponent = Vue . extend ( {
46+ template : '<span>{{val}}</span>' ,
47+ computed : {
48+ val ( ) {
49+ return this . $store . state . val
50+ }
51+ }
52+ } )
53+ const TestComponent = {
54+ template : '<div><child-component /></div>' ,
55+ components : {
56+ ChildComponent
5057 }
5158 }
52- } )
53- const TestComponent = {
54- template : '<div><child-component /></div>' ,
55- components : {
56- ChildComponent
59+ const wrapper = mountingMethod ( TestComponent , {
60+ localVue,
61+ store
62+ } )
63+ const HTML = mountingMethod . name === 'renderToString'
64+ ? wrapper
65+ : wrapper . html ( )
66+ if ( mountingMethod . name === 'shallowMount' ) {
67+ expect ( HTML ) . to . not . contain ( '2' )
68+ } else {
69+ expect ( HTML ) . to . contain ( '2' )
5770 }
58- }
59- const wrapper = mountingMethod ( TestComponent , {
60- localVue,
61- store
6271 } )
63- const HTML = mountingMethod . name === 'renderToString'
64- ? wrapper
65- : wrapper . html ( )
66- if ( mountingMethod . name === 'shallowMount' ) {
67- expect ( HTML ) . to . not . contain ( '2' )
68- } else {
69- expect ( HTML ) . to . contain ( '2' )
70- }
71- } )
7272} )
0 commit comments