File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -183,9 +183,6 @@ describe('Vuex', () => {
183
183
state : {
184
184
a : 1
185
185
} ,
186
- actions : {
187
- test : TEST
188
- } ,
189
186
mutations : {
190
187
[ TEST ] ( state , n ) {
191
188
state . a += n
@@ -204,7 +201,7 @@ describe('Vuex', () => {
204
201
]
205
202
} )
206
203
expect ( initState ) . to . equal ( store . state )
207
- store . actions . test ( 2 )
204
+ store . dispatch ( TEST , 2 )
208
205
expect ( mutations . length ) . to . equal ( 1 )
209
206
expect ( mutations [ 0 ] . type ) . to . equal ( TEST )
210
207
expect ( mutations [ 0 ] . payload [ 0 ] ) . to . equal ( 2 )
@@ -217,9 +214,6 @@ describe('Vuex', () => {
217
214
state : {
218
215
a : 1
219
216
} ,
220
- actions : {
221
- test : TEST
222
- } ,
223
217
mutations : {
224
218
[ TEST ] ( state , n ) {
225
219
state . a += n
@@ -243,7 +237,7 @@ describe('Vuex', () => {
243
237
} )
244
238
expect ( initState ) . not . to . equal ( store . state )
245
239
expect ( initState . a ) . to . equal ( 1 )
246
- store . actions . test ( 2 )
240
+ store . dispatch ( TEST , 2 )
247
241
expect ( mutations . length ) . to . equal ( 1 )
248
242
expect ( mutations [ 0 ] . mutation . type ) . to . equal ( TEST )
249
243
expect ( mutations [ 0 ] . mutation . payload [ 0 ] ) . to . equal ( 2 )
@@ -257,15 +251,10 @@ describe('Vuex', () => {
257
251
state : {
258
252
a : 1
259
253
} ,
260
- actions : {
261
- test : ( { dispatch, state } ) => {
262
- state . a ++
263
- }
264
- } ,
265
254
strict : true
266
255
} )
267
256
expect ( ( ) => {
268
- store . actions . test ( 2 )
257
+ store . state . a ++
269
258
} ) . to . throw ( / D o n o t m u t a t e v u e x s t o r e s t a t e o u t s i d e m u t a t i o n h a n d l e r s / )
270
259
} )
271
260
} )
You can’t perform that action at this time.
0 commit comments