1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/packages/app-mobile/utils/testing/createMockReduxStore.ts

20 lines
574 B
TypeScript

import reducer from '@joplin/lib/reducer';
import { createStore } from 'redux';
import appDefaultState from '../appDefaultState';
import Setting from '@joplin/lib/models/Setting';
const defaultState = {
...appDefaultState,
// Mocking theme in the default state is necessary to prevent "Theme not set!" warnings.
settings: { theme: Setting.THEME_LIGHT },
};
const testReducer = (state = defaultState, action: unknown) => {
return reducer(state, action);
};
const createMockReduxStore = () => {
return createStore(testReducer);
};
export default createMockReduxStore;