File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class Store {
5353 }
5454
5555 get state ( ) {
56- return this . _vm . state
56+ return this . _vm . $data . state
5757 }
5858
5959 set state ( v ) {
Original file line number Diff line number Diff line change @@ -173,10 +173,10 @@ describe('Vuex', () => {
173173 it ( 'getters' , ( ) => {
174174 const store = new Vuex . Store ( {
175175 state : {
176- a : 1
176+ a : 0
177177 } ,
178178 getters : {
179- hasAny : state => state . a > 1
179+ state : state => state . a > 0 ? 'hasAny' : 'none'
180180 } ,
181181 mutations : {
182182 [ TEST ] ( state , n ) {
@@ -186,17 +186,17 @@ describe('Vuex', () => {
186186 actions : {
187187 check ( { getters } , value ) {
188188 // check for exposing getters into actions
189- expect ( getters . hasAny ) . toBe ( value )
189+ expect ( getters . state ) . toBe ( value )
190190 }
191191 }
192192 } )
193- expect ( store . getters . hasAny ) . toBe ( false )
194- store . dispatch ( 'check' , false )
193+ expect ( store . getters . state ) . toBe ( 'none' )
194+ store . dispatch ( 'check' , 'none' )
195195
196196 store . commit ( TEST , 1 )
197197
198- expect ( store . getters . hasAny ) . toBe ( true )
199- store . dispatch ( 'check' , true )
198+ expect ( store . getters . state ) . toBe ( 'hasAny' )
199+ store . dispatch ( 'check' , 'hasAny' )
200200 } )
201201
202202 it ( 'dynamic module registration' , ( ) => {
You can’t perform that action at this time.
0 commit comments