From a90bd5b1c46ec65990651e80bae4d17721eba2a4 Mon Sep 17 00:00:00 2001 From: AlexisG Date: Mon, 23 Dec 2024 16:55:23 +0100 Subject: [PATCH 1/2] feat(cozy-harvest): Add missing react-redux dep --- packages/cozy-harvest-lib/package.json | 1 + yarn.lock | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cozy-harvest-lib/package.json b/packages/cozy-harvest-lib/package.json index 02ffc55780..c8409a1d08 100644 --- a/packages/cozy-harvest-lib/package.json +++ b/packages/cozy-harvest-lib/package.json @@ -42,6 +42,7 @@ "react-final-form": "^3.7.0", "react-json-print": "^0.1.3", "react-markdown": "^4.2.2", + "react-redux":"7.2.2", "use-deep-compare-effect": "^1.8.1", "uuid": "^3.3.2" }, diff --git a/yarn.lock b/yarn.lock index 1d7c9bd0c5..0398911b23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23254,7 +23254,7 @@ react-popper@^2.2.3: react-fast-compare "^3.0.1" warning "^4.0.2" -react-redux@^7.0.3, react-redux@^7.1.1, react-redux@^7.2.0: +react-redux@7.2.2, react-redux@^7.0.3, react-redux@^7.1.1, react-redux@^7.2.0: version "7.2.2" resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.2.tgz#03862e803a30b6b9ef8582dadcc810947f74b736" integrity sha512-8+CQ1EvIVFkYL/vu6Olo7JFLWop1qRUeb46sGtIMDCSpgwPQq8fPLpirIB0iTqFe9XYEFPHssdX8/UwN6pAkEA== From e7af75af206fff7ac0e1e138250d465ba88b7aad Mon Sep 17 00:00:00 2001 From: AlexisG Date: Mon, 23 Dec 2024 16:55:59 +0100 Subject: [PATCH 2/2] feat(cozy-harvest): Prefer use createMockClient for tests --- packages/cozy-harvest-lib/test/AppLike.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/cozy-harvest-lib/test/AppLike.jsx b/packages/cozy-harvest-lib/test/AppLike.jsx index 68d3582caa..357e224527 100644 --- a/packages/cozy-harvest-lib/test/AppLike.jsx +++ b/packages/cozy-harvest-lib/test/AppLike.jsx @@ -1,7 +1,10 @@ import React from 'react' import { Provider as ReduxProvider } from 'react-redux' -import CozyClient, { CozyProvider as CozyClientProvider } from 'cozy-client' +import { + CozyProvider as CozyClientProvider, + createMockClient +} from 'cozy-client' import { useCozyDialog } from 'cozy-ui/transpiled/react/CozyDialogs' import AlertProvider from 'cozy-ui/transpiled/react/providers/Alert' import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints' @@ -11,8 +14,7 @@ import I18n from 'cozy-ui/transpiled/react/providers/I18n' import DialogContext from '../src/components/DialogContext' import enLocale from '../src/locales/en.json' -const defaultClient = new CozyClient() -defaultClient.ensureStore() +const defaultClient = createMockClient({}) const AppLike = ({ client: clientOption,