diff --git a/src/app/store/modules/cart/actions/cartAction.js b/src/app/store/modules/cart/actions/cartAction.js index 16c910ca..7b30ee8e 100644 --- a/src/app/store/modules/cart/actions/cartAction.js +++ b/src/app/store/modules/cart/actions/cartAction.js @@ -3,4 +3,4 @@ import * as types from '@/store/ActionTypes'; import { makeActionCreator } from '@/store/helpers/makeActionCreator'; -export default makeActionCreator(types.CART_DATA, 'cart'); +export default makeActionCreator(types.CART_DATA); diff --git a/src/app/store/modules/cart/actions/cartAction.test.js b/src/app/store/modules/cart/actions/cartAction.test.js index ca817cac..d3961f52 100644 --- a/src/app/store/modules/cart/actions/cartAction.test.js +++ b/src/app/store/modules/cart/actions/cartAction.test.js @@ -3,9 +3,10 @@ import cartAction from './cartAction'; describe('cartAction action', () => { - it('should return the quantity', () => { + it('should return cart object', () => { const quantity = 0; - const expectedData = { type: 'CART_DATA', cart: { quantity } }; - expect(cartAction({ quantity })).toEqual(expectedData); + const payload = { cart: { quantity } }; + const expectedData = { type: 'CART_DATA', payload }; + expect(cartAction(payload)).toEqual(expectedData); }); });