@@ -37,36 +37,36 @@ describeWithMountingMethods('options.localVue', (mountingMethod) => {
37
37
itSkipIf (
38
38
vueVersion < 2.3 ,
39
39
'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
50
57
}
51
58
}
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' )
57
70
}
58
- }
59
- const wrapper = mountingMethod ( TestComponent , {
60
- localVue,
61
- store
62
71
} )
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
- } )
72
72
} )
0 commit comments