stub latl reducer
This commit is contained in:
parent
ff681e6223
commit
201b4ca8b9
3 changed files with 22 additions and 0 deletions
|
@ -12,6 +12,7 @@ import type { resultsAction } from './reducer.results'
|
||||||
import { initState } from './reducer.init';
|
import { initState } from './reducer.init';
|
||||||
import type { initAction } from './reducer.init';
|
import type { initAction } from './reducer.init';
|
||||||
import { clearOutput } from './reducer.clear';
|
import { clearOutput } from './reducer.clear';
|
||||||
|
import { setLatl } from './reducer.latl';
|
||||||
|
|
||||||
export type stateType = {
|
export type stateType = {
|
||||||
lexicon: Array<{lexeme: string, epoch: epochType}>,
|
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_OPTIONS': return setOptions(state, action);
|
||||||
|
|
||||||
|
case 'SET_LATL': return setLatl(state, action);
|
||||||
|
|
||||||
case 'CLEAR': return clearOutput(state, action);
|
case 'CLEAR': return clearOutput(state, action);
|
||||||
|
|
||||||
case 'RUN': return run(state, action);
|
case 'RUN': return run(state, action);
|
||||||
|
|
5
src/reducers/reducer.latl.js
Normal file
5
src/reducers/reducer.latl.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
|
export const setLatl = (state, action) => {
|
||||||
|
return {...state};
|
||||||
|
}
|
14
src/reducers/reducer.latl.test.js
Normal file
14
src/reducers/reducer.latl.test.js
Normal 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);
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in a new issue