Switch to @jedmao/redux-mock-store

update-emoji-mart
Alex Gleason 2022-07-06 13:56:55 -05:00
rodzic 2dd1631162
commit 06d3f00170
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
3 zmienionych plików z 11 dodań i 13 usunięć

Wyświetl plik

@ -1,3 +1,4 @@
import { configureMockStore } from '@jedmao/redux-mock-store';
import { render, RenderOptions } from '@testing-library/react';
import { merge } from 'immutable';
import React, { FC, ReactElement } from 'react';
@ -5,20 +6,19 @@ import { IntlProvider } from 'react-intl';
import { Provider } from 'react-redux';
import { MemoryRouter } from 'react-router-dom';
import { Action, applyMiddleware, createStore } from 'redux';
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import '@testing-library/jest-dom';
import NotificationsContainer from '../features/ui/containers/notifications_container';
import { default as rootReducer } from '../reducers';
import type { StateRecord } from 'soapbox/reducers';
import type { AnyAction } from 'redux';
import type { AppDispatch } from 'soapbox/store';
// Mock Redux
// https://redux.js.org/recipes/writing-tests/
const middlewares = [thunk];
const mockStore = configureMockStore(middlewares);
let rootState = rootReducer(undefined, {} as Action) as unknown as ReturnType<typeof StateRecord>;
let rootState = rootReducer(undefined, {} as Action);
const mockStore = configureMockStore<typeof rootState, AnyAction, AppDispatch>([thunk]);
/** Apply actions to the state, one at a time. */
const applyActions = (state: any, actions: any, reducer: any) => {

Wyświetl plik

@ -202,6 +202,7 @@
"wicg-inert": "^3.1.1"
},
"devDependencies": {
"@jedmao/redux-mock-store": "^3.0.5",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.0.3",
@ -225,7 +226,6 @@
"lint-staged": ">=10",
"raf": "^3.4.1",
"react-intl-translations-manager": "^5.0.3",
"redux-mock-store": "^1.5.4",
"stylelint": "^13.7.2",
"stylelint-config-standard": "^22.0.0",
"stylelint-scss": "^3.18.0",

Wyświetl plik

@ -1603,6 +1603,11 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98"
integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==
"@jedmao/redux-mock-store@^3.0.5":
version "3.0.5"
resolved "https://registry.yarnpkg.com/@jedmao/redux-mock-store/-/redux-mock-store-3.0.5.tgz#015fa4fc96bfc02b61ca221d9ea0476b78c70c97"
integrity sha512-zNcVCd5/ekSMdQWk64CqTPM24D9Lo59st9KvS+fljGpQXV4SliB7Vo0NFQIgvQJWPYeeobdngnrGy0XbCaARNw==
"@jest/console@^27.5.1":
version "27.5.1"
resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.1.tgz#260fe7239602fe5130a94f1aa386eff54b014bba"
@ -10028,13 +10033,6 @@ redux-immutable@^4.0.0:
resolved "https://registry.yarnpkg.com/redux-immutable/-/redux-immutable-4.0.0.tgz#3a1a32df66366462b63691f0e1dc35e472bbc9f3"
integrity sha1-Ohoy32Y2ZGK2NpHw4dw15HK7yfM=
redux-mock-store@^1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/redux-mock-store/-/redux-mock-store-1.5.4.tgz#90d02495fd918ddbaa96b83aef626287c9ab5872"
integrity sha512-xmcA0O/tjCLXhh9Fuiq6pMrJCwFRaouA8436zcikdIpYWWCjU76CRk+i2bHx8EeiSiMGnB85/lZdU3wIJVXHTA==
dependencies:
lodash.isplainobject "^4.0.6"
redux-thunk@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"