rootReducer(undefined, {} as any) --> rootState
This commit is contained in:
parent
e9112506c6
commit
afe1edddf9
|
@ -1,7 +1,7 @@
|
||||||
import { Map as ImmutableMap } from 'immutable';
|
import { Map as ImmutableMap } from 'immutable';
|
||||||
|
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
import { mockStore, rootState, rootReducer } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { ListRecord, ReducerRecord } from 'soapbox/reducers/user_lists';
|
import { ListRecord, ReducerRecord } from 'soapbox/reducers/user_lists';
|
||||||
|
|
||||||
import { normalizeAccount, normalizeInstance, normalizeRelationship } from '../../normalizers';
|
import { normalizeAccount, normalizeInstance, normalizeRelationship } from '../../normalizers';
|
||||||
|
@ -74,7 +74,7 @@ describe('fetchAccount()', () => {
|
||||||
avatar: 'test.jpg',
|
avatar: 'test.jpg',
|
||||||
});
|
});
|
||||||
|
|
||||||
const state = rootReducer(undefined, {} as any)
|
const state = rootState
|
||||||
.set('accounts', ImmutableMap({
|
.set('accounts', ImmutableMap({
|
||||||
[id]: account,
|
[id]: account,
|
||||||
}) as any);
|
}) as any);
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { Provider } from 'react-redux';
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
import { normalizePoll } from 'soapbox/normalizers/poll';
|
import { normalizePoll } from 'soapbox/normalizers/poll';
|
||||||
|
|
||||||
import { mockStore, render, rootReducer, screen } from '../../../jest/test-helpers';
|
import { mockStore, render, screen, rootState } from '../../../jest/test-helpers';
|
||||||
import PollFooter from '../poll-footer';
|
import PollFooter from '../poll-footer';
|
||||||
|
|
||||||
let poll = normalizePoll({
|
let poll = normalizePoll({
|
||||||
|
@ -36,7 +36,7 @@ describe('<PollFooter />', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const user = userEvent.setup();
|
const user = userEvent.setup();
|
||||||
const store = mockStore(rootReducer(undefined, {} as any));
|
const store = mockStore(rootState);
|
||||||
render(
|
render(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<IntlProvider locale='en'>
|
<IntlProvider locale='en'>
|
||||||
|
|
|
@ -5,12 +5,11 @@ import { Provider } from 'react-redux';
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
||||||
|
|
||||||
import { MODAL_OPEN } from 'soapbox/actions/modals';
|
import { MODAL_OPEN } from 'soapbox/actions/modals';
|
||||||
import { mockStore } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import rootReducer from 'soapbox/reducers';
|
|
||||||
|
|
||||||
import ComposeButton from '../compose-button';
|
import ComposeButton from '../compose-button';
|
||||||
|
|
||||||
const store = mockStore(rootReducer(undefined, {} as any));
|
const store = mockStore(rootState);
|
||||||
const renderComposeButton = () => {
|
const renderComposeButton = () => {
|
||||||
render(
|
render(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
|
|
Loading…
Reference in New Issue