|
@@ -133,15 +133,15 @@ If you have spies available in your testing environment (for example via [Sinon.
|
|
``` js
|
|
``` js
|
|
describe('actions', () => {
|
|
describe('actions', () => {
|
|
it('getAllProducts', () => {
|
|
it('getAllProducts', () => {
|
|
- const commit = sinon.spy();
|
|
|
|
- const state = {};
|
|
|
|
|
|
+ const commit = sinon.spy()
|
|
|
|
+ const state = {}
|
|
|
|
|
|
- actions.getAllProducts({ commit, state });
|
|
|
|
|
|
+ actions.getAllProducts({ commit, state })
|
|
|
|
|
|
expect(dispatch.args).to.deep.equal([
|
|
expect(dispatch.args).to.deep.equal([
|
|
[ 'REQUEST_PRODUCTS' ],
|
|
[ 'REQUEST_PRODUCTS' ],
|
|
[ 'RECEIVE_PRODUCTS', { /* mocked response */ } ]
|
|
[ 'RECEIVE_PRODUCTS', { /* mocked response */ } ]
|
|
- ]);
|
|
|
|
|
|
+ ])
|
|
})
|
|
})
|
|
})
|
|
})
|
|
```
|
|
```
|