diff --git a/src/app/store/modules/footer/actions/footerData.js b/src/app/store/modules/footer/actions/footerAction.js similarity index 68% rename from src/app/store/modules/footer/actions/footerData.js rename to src/app/store/modules/footer/actions/footerAction.js index 71fddd7b..7c8d0f8e 100644 --- a/src/app/store/modules/footer/actions/footerData.js +++ b/src/app/store/modules/footer/actions/footerAction.js @@ -3,4 +3,4 @@ import * as types from '@/store/ActionTypes'; import { makeActionCreator } from '@/store/helpers/makeActionCreator'; -export default makeActionCreator(types.FOOTER_DATA, 'footer'); +export default makeActionCreator(types.FOOTER_DATA); diff --git a/src/app/store/modules/footer/actions/footerAction.test.js b/src/app/store/modules/footer/actions/footerAction.test.js new file mode 100644 index 00000000..dde1c3e3 --- /dev/null +++ b/src/app/store/modules/footer/actions/footerAction.test.js @@ -0,0 +1,16 @@ +// @flow strict + +import footerAction from './footerAction'; + +describe('footer action', () => { + it('should return the corresponding \'footer\' object', () => { + const social = [{ id: '0', icon: 'instagram', link: 'https://instagram.com' }]; + const contact = { + phone: '89189258147', + email: 'me@shop.com', + }; + const payload = { footer: { social, contact } }; + const expectedData = { type: 'FOOTER_DATA', payload }; + expect(footerAction(payload)).toEqual(expectedData); + }); +}); diff --git a/src/app/store/modules/footer/actions/footerData.test.js b/src/app/store/modules/footer/actions/footerData.test.js deleted file mode 100644 index cc3f341a..00000000 --- a/src/app/store/modules/footer/actions/footerData.test.js +++ /dev/null @@ -1,17 +0,0 @@ -// @flow strict - -import footerData from './footerData'; - -import type { FooterType } from '@/store/types/FooterType'; - -describe('footerData action', () => { - it('should return the corresponding \'footer\' object', () => { - const social = [{ id: '0', icon: 'instagram', link: 'https://instagram.com' }]; - const contact = { - phone: '89189258147', - email: 'me@shop.com', - }; - const expectedData: FooterType = { type: 'FOOTER_DATA', footer: { social, contact } }; - expect(footerData({ social, contact })).toEqual(expectedData); - }); -}); diff --git a/src/app/store/modules/footer/actions/index.js b/src/app/store/modules/footer/actions/index.js index 1e137a61..ecefdd62 100644 --- a/src/app/store/modules/footer/actions/index.js +++ b/src/app/store/modules/footer/actions/index.js @@ -1,3 +1,3 @@ // @flow strict // eslint-disable-next-line import/prefer-default-export -export { default as footerData } from './footerData'; +export { default as footerAction } from './footerAction';