diff --git a/src/tags/reducers/tagDelete.js b/src/tags/reducers/tagDelete.js index 4e2f40b6..3b70f460 100644 --- a/src/tags/reducers/tagDelete.js +++ b/src/tags/reducers/tagDelete.js @@ -19,7 +19,7 @@ const defaultState = { error: false, }; -export default function reduce(state = defaultState, action) { +export default function reducer(state = defaultState, action) { switch (action.type) { case DELETE_TAG_START: return { diff --git a/test/servers/reducers/selectedServer.test.js b/test/servers/reducers/selectedServer.test.js index 74ea4b99..e8cf174f 100644 --- a/test/servers/reducers/selectedServer.test.js +++ b/test/servers/reducers/selectedServer.test.js @@ -1,5 +1,5 @@ import * as sinon from 'sinon'; -import reduce, { +import reducer, { _selectServer, RESET_SELECTED_SERVER, resetSelectedServer, @@ -8,17 +8,17 @@ import reduce, { import { RESET_SHORT_URL_PARAMS } from '../../../src/short-urls/reducers/shortUrlsListParams'; describe('selectedServerReducer', () => { - describe('reduce', () => { + describe('reducer', () => { it('returns default when action is not handled', () => - expect(reduce(null, { type: 'unknown' })).toEqual(null)); + expect(reducer(null, { type: 'unknown' })).toEqual(null)); it('returns default when action is RESET_SELECTED_SERVER', () => - expect(reduce(null, { type: RESET_SELECTED_SERVER })).toEqual(null)); + expect(reducer(null, { type: RESET_SELECTED_SERVER })).toEqual(null)); it('returns selected server when action is SELECT_SERVER', () => { const selectedServer = { id: 'abc123' }; - expect(reduce(null, { type: SELECT_SERVER, selectedServer })).toEqual(selectedServer); + expect(reducer(null, { type: SELECT_SERVER, selectedServer })).toEqual(selectedServer); }); }); diff --git a/test/servers/reducers/server.test.js b/test/servers/reducers/server.test.js index b015603e..2449aba4 100644 --- a/test/servers/reducers/server.test.js +++ b/test/servers/reducers/server.test.js @@ -1,6 +1,6 @@ import * as sinon from 'sinon'; import { values } from 'ramda'; -import reduce, { +import reducer, { _createServer, _deleteServer, _listServers, @@ -20,12 +20,12 @@ describe('serverReducer', () => { createServers: sinon.fake(), }; - describe('reduce', () => { + describe('reducer', () => { it('returns servers when action is FETCH_SERVERS', () => - expect(reduce({}, { type: FETCH_SERVERS, servers })).toEqual(servers)); + expect(reducer({}, { type: FETCH_SERVERS, servers })).toEqual(servers)); it('returns default when action is unknown', () => - expect(reduce({}, { type: 'unknown' })).toEqual({})); + expect(reducer({}, { type: 'unknown' })).toEqual({})); }); describe('action creators', () => { diff --git a/test/short-urls/reducers/shortUrlsListParams.test.js b/test/short-urls/reducers/shortUrlsListParams.test.js index 89b43aec..848691bc 100644 --- a/test/short-urls/reducers/shortUrlsListParams.test.js +++ b/test/short-urls/reducers/shortUrlsListParams.test.js @@ -1,24 +1,24 @@ -import reduce, { +import reducer, { RESET_SHORT_URL_PARAMS, resetShortUrlParams, } from '../../../src/short-urls/reducers/shortUrlsListParams'; import { LIST_SHORT_URLS } from '../../../src/short-urls/reducers/shortUrlsList'; describe('shortUrlsListParamsReducer', () => { - describe('reducer', () => { + describe('reducerr', () => { const defaultState = { page: '1' }; it('returns default value when action is unknown', () => - expect(reduce(defaultState, { type: 'unknown' })).toEqual(defaultState)); + expect(reducer(defaultState, { type: 'unknown' })).toEqual(defaultState)); it('returns params when action is LIST_SHORT_URLS', () => - expect(reduce(defaultState, { type: LIST_SHORT_URLS, params: { searchTerm: 'foo' } })).toEqual({ + expect(reducer(defaultState, { type: LIST_SHORT_URLS, params: { searchTerm: 'foo' } })).toEqual({ ...defaultState, searchTerm: 'foo', })); it('returns default value when action is RESET_SHORT_URL_PARAMS', () => - expect(reduce(defaultState, { type: RESET_SHORT_URL_PARAMS })).toEqual(defaultState)); + expect(reducer(defaultState, { type: RESET_SHORT_URL_PARAMS })).toEqual(defaultState)); }); describe('resetShortUrlParams', () => {