stub latl reducer

This commit is contained in:
Sorrel Bri 2020-02-29 12:52:20 -08:00
parent ff681e6223
commit 201b4ca8b9
3 changed files with 22 additions and 0 deletions

View file

@ -12,6 +12,7 @@ import type { resultsAction } from './reducer.results'
import { initState } from './reducer.init';
import type { initAction } from './reducer.init';
import { clearOutput } from './reducer.clear';
import { setLatl } from './reducer.latl';
export type stateType = {
lexicon: Array<{lexeme: string, epoch: epochType}>,
@ -60,6 +61,8 @@ export const stateReducer = (state: stateType, action: actionType): stateType =>
case 'SET_OPTIONS': return setOptions(state, action);
case 'SET_LATL': return setLatl(state, action);
case 'CLEAR': return clearOutput(state, action);
case 'RUN': return run(state, action);

View file

@ -0,0 +1,5 @@
export const setLatl = (state, action) => {
return {...state};
}

View file

@ -0,0 +1,14 @@
import { stateReducer } from './reducer';
import { initState } from './reducer.init';
describe('LATL', () => {
it('returns state unaltered with no action body', () => {
const state = initState();
const action = {
type: 'SET_LATL',
value: {}
}
const returnedState = stateReducer(state, action)
expect(returnedState).toStrictEqual(state);
})
})