Skip to content
Snippets Groups Projects
Commit c17b60a1 authored by Jack Reed's avatar Jack Reed Committed by Chris Beer
Browse files

Remove unused plugin preprocessing addPluginReducersToStore

parent 41d47346
No related branches found
No related tags found
No related merge requests found
import {
filterValidPlugins,
addPluginReducersToStore,
} from '../../../src/extend/pluginPreprocessing';
describe('filterValidPlugins', () => {
......@@ -43,40 +42,3 @@ describe('filterValidPlugins', () => {
expect(result.map(r => r.name)).toEqual(['valid plugin 1', 'valid plugin 2']);
});
});
describe('addPluginReducersToStore', () => {
const store = { replaceReducer: jest.fn() };
const createRootReducer = jest.fn(pluginReducers => pluginReducers);
/** */ const fooReducer = x => x;
/** */ const barReducer = x => x;
/** */ const bazReducer = x => x;
const plugins = [
{
component: props => null,
mode: 'add',
reducers: {
bar: barReducer,
foo: fooReducer,
},
target: 'Window',
},
{
component: props => null,
mode: 'add',
reducers: {
baz: bazReducer,
},
target: 'Window',
},
];
addPluginReducersToStore(store, createRootReducer, plugins);
expect(store.replaceReducer.mock.calls.length).toBe(1);
expect(store.replaceReducer.mock.calls[0][0]).toEqual({
bar: barReducer,
baz: bazReducer,
foo: fooReducer,
});
});
......@@ -7,12 +7,6 @@ export function filterValidPlugins(plugins) {
return validPlugins;
}
/** */
export function addPluginReducersToStore(store, createRootReducer, plugins) {
const pluginReducers = getReducersFromPlugins(plugins);
store.replaceReducer(createRootReducer(pluginReducers));
}
/** */
function splitPluginsByValidation(plugins) {
const invalidPlugins = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment