Run rootReducer in tests

This commit is contained in:
Alex Gleason 2021-01-18 14:14:08 -06:00
parent fb99d36494
commit 47ed1e42c9
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 4 additions and 2 deletions

View file

@ -16,7 +16,7 @@ exports[`<EmojiSelector /> renders correctly 1`] = `
className="emoji-react-selector__emoji" className="emoji-react-selector__emoji"
dangerouslySetInnerHTML={ dangerouslySetInnerHTML={
Object { Object {
"__html": "<img draggable=\\"false\\" class=\\"emojione\\" alt=\\"❤\\" title=\\":heart:\\" src=\\"/emoji/2764.svg\\" />", "__html": "<img draggable=\\"false\\" class=\\"emojione\\" alt=\\"❤\\" title=\\":heart:\\" src=\\"/emoji/2764.svg\\" />",
} }
} }
/> />

View file

@ -11,6 +11,7 @@ describe('instance reducer', () => {
max_options: 4, max_options: 4,
min_expiration: 300, min_expiration: 300,
}), }),
version: '0.0.0',
})); }));
}); });
}); });

View file

@ -8,6 +8,7 @@ import { IntlProvider } from 'react-intl';
import { BrowserRouter } from 'react-router-dom'; import { BrowserRouter } from 'react-router-dom';
import configureMockStore from 'redux-mock-store'; import configureMockStore from 'redux-mock-store';
import { Map as ImmutableMap } from 'immutable'; import { Map as ImmutableMap } from 'immutable';
import rootReducer from 'soapbox/reducers';
// Mock Redux // Mock Redux
// https://redux.js.org/recipes/writing-tests/ // https://redux.js.org/recipes/writing-tests/
@ -18,7 +19,7 @@ export const mockStore = configureMockStore(middlewares);
export const createComponent = (children, props = {}) => { export const createComponent = (children, props = {}) => {
props = ImmutableMap({ props = ImmutableMap({
locale: 'en', locale: 'en',
store: mockStore(ImmutableMap()), store: mockStore(rootReducer(ImmutableMap(), {})),
}).merge(props); }).merge(props);
return renderer.create( return renderer.create(