Tests: DRY mockStore()

stable/1.0.x
Alex Gleason 2020-06-09 17:28:32 -05:00
rodzic 628d73eb81
commit 23039c353e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -1,5 +1,3 @@
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import {
FETCH_ABOUT_PAGE_REQUEST,
FETCH_ABOUT_PAGE_SUCCESS,
@ -8,9 +6,7 @@ import {
} from '../about';
import { Map as ImmutableMap } from 'immutable';
import { __stub as stubApi } from 'soapbox/api';
const middlewares = [thunk];
const mockStore = configureMockStore(middlewares);
import { mockStore } from 'soapbox/test_setup';
describe('fetchAboutPage()', () => {
it('creates the expected actions on success', () => {

Wyświetl plik

@ -2,6 +2,8 @@
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import thunk from 'redux-thunk';
import configureMockStore from 'redux-mock-store';
import { __clear as clearApiMocks } from 'soapbox/api';
const adapter = new Adapter();
@ -9,3 +11,6 @@ configure({ adapter });
jest.mock('soapbox/api');
afterEach(() => clearApiMocks());
const middlewares = [thunk];
export const mockStore = configureMockStore(middlewares);