Run rootReducer in tests
This commit is contained in:
parent
fb99d36494
commit
47ed1e42c9
3 changed files with 4 additions and 2 deletions
|
@ -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\\" />",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -11,6 +11,7 @@ describe('instance reducer', () => {
|
||||||
max_options: 4,
|
max_options: 4,
|
||||||
min_expiration: 300,
|
min_expiration: 300,
|
||||||
}),
|
}),
|
||||||
|
version: '0.0.0',
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue