Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ARCH-345): update all redux related packages #3027

Merged
merged 139 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from 124 commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
2d74cad
chore: update all redux related packages
jmfrancois Oct 28, 2020
edb0d70
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Nov 27, 2020
c1bdb8c
chore: align
jmfrancois Nov 27, 2020
37d1480
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Nov 27, 2020
40a1e10
chore(ci): update code style outputs
Nov 27, 2020
7963faa
chore: refactor CMFContainer as a function
jmfrancois Nov 30, 2020
f28168d
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Nov 30, 2020
851fefa
chore(ci): update code style outputs
Nov 30, 2020
8cb7a36
fix: onEvent
jmfrancois Dec 3, 2020
3063819
chore(ci): update code style outputs
Dec 3, 2020
ae4f405
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 3, 2020
fa0b709
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Dec 3, 2020
4911277
chore(ci): update code style outputs
Dec 3, 2020
cf585b9
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 16, 2020
9d689f3
chore: update
jmfrancois Dec 16, 2020
a38f874
chore: update ui-scripts
jmfrancois Dec 17, 2020
3b9d165
test: fix some
jmfrancois Dec 17, 2020
8b1b973
test: fix some of them
jmfrancois Dec 17, 2020
d607b50
chore(ci): prettier
Dec 17, 2020
c1a0fd5
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 22, 2020
92caa78
fix: update import of delays
jmfrancois Dec 22, 2020
9366861
test: fix onError setup
jmfrancois Dec 22, 2020
3e2468f
test: fix settings setup
jmfrancois Dec 22, 2020
34f2a67
chore(ci): update code style outputs
Dec 22, 2020
a5be602
test: fix some setup
jmfrancois Dec 22, 2020
e8e6d05
chore: update cmf to use new style context
jmfrancois Dec 22, 2020
5da0ed8
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Dec 22, 2020
afdc8b5
chore(ci): update code style outputs
Dec 22, 2020
33460f9
chore(ci): prettier
Dec 22, 2020
4307bec
chore: update mock to have more easy setup in tests
jmfrancois Dec 22, 2020
394fc74
chore: continue to cleanup tests
jmfrancois Dec 22, 2020
43d2f9f
test: 8 test fixed
jmfrancois Dec 22, 2020
7c81c2f
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Dec 22, 2020
94cdca5
chore(ci): update code style outputs
Dec 22, 2020
ba0e3b9
chore(ci): prettier
Dec 22, 2020
92c7962
chore: cleanup and fix last tests
jmfrancois Dec 23, 2020
1b94987
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Dec 23, 2020
4d76dee
chore(ci): update code style outputs
Dec 23, 2020
597cb61
chore(ci): prettier
Dec 23, 2020
a7ed9a8
test: fix outside tests using context
jmfrancois Dec 23, 2020
e3ad6cf
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Dec 23, 2020
7e818a9
chore(ci): prettier
Dec 23, 2020
222d8bb
feat(cmf): expose hook to get context
jmfrancois Dec 23, 2020
4fb0d69
test: fix some of them
jmfrancois Dec 23, 2020
f30ce04
feat(cmf): expose hook to get context
jmfrancois Dec 23, 2020
76f5d83
test: update snapshot
jmfrancois Dec 23, 2020
c5f4abf
test: fix actionbar and notification
jmfrancois Dec 23, 2020
16e5f96
test: fix actions
jmfrancois Dec 23, 2020
61d2f59
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Dec 23, 2020
f774e8e
chore(ci): prettier
Dec 23, 2020
fec01c1
fix: container storybook
jmfrancois Dec 23, 2020
3988125
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Dec 23, 2020
f71e7b9
chore(ci): update code style outputs
Dec 23, 2020
3fa9901
chore: refactor List container to useCMFContext
jmfrancois Dec 23, 2020
9754b30
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Dec 23, 2020
ea67b9f
chore(ci): update code style outputs
Dec 23, 2020
d28890b
chore(ci): prettier
Dec 23, 2020
a0fea9a
test: fix all
jmfrancois Dec 23, 2020
a7df976
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Dec 23, 2020
e57a917
chore(ci): update code style outputs
Dec 23, 2020
db5950a
chore(ci): prettier
Dec 23, 2020
51c38f3
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Jan 13, 2021
821af21
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Feb 17, 2021
5437e30
chore: update
jmfrancois Feb 17, 2021
7d0b0c4
chore: prepare router release
jmfrancois Feb 18, 2021
4abf757
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Apr 29, 2021
618e7b1
test: update snap
jmfrancois Apr 29, 2021
ff92f3c
chore: yarn upgrade
jmfrancois Apr 29, 2021
99af4bd
chore: upgrade babel-import-from-index
jmfrancois Apr 29, 2021
c13a84c
chore: ugprade router
jmfrancois Apr 29, 2021
442d514
Merge branch 'master' into jmfrancois/chore/update-redux
romainseb May 18, 2021
35fbe44
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Sep 9, 2021
43a34a9
chore: update
jmfrancois Sep 9, 2021
5ecce3e
Merge 43a34a968f6c306fa2640dad444124909f099ae9 into c99784e64bacc4010…
jmfrancois Sep 9, 2021
554ccae
chore: yarn-deduplicate
github-actions[bot] Sep 9, 2021
cb84f47
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Sep 9, 2021
1140bfe
chore: update
jmfrancois Sep 9, 2021
2ff6620
chore: upgrade ui-scripts
jmfrancois Sep 9, 2021
282fb83
chore: upgrade react-dnd
jmfrancois Sep 9, 2021
69912e1
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Sep 9, 2021
81e0b21
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Sep 9, 2021
77de646
test: fix cmf router
jmfrancois Sep 9, 2021
37c253d
test: fix cmf tests
jmfrancois Sep 9, 2021
be06e84
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Sep 24, 2021
1435b9a
chore: add changeset
jmfrancois Sep 24, 2021
a523772
chore: release forms
jmfrancois Sep 27, 2021
4624723
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Sep 28, 2021
a360cf7
fix: version
jmfrancois Oct 1, 2021
f3e8ac4
Merge a360cf73884bf9e559a14010e5b5f9fd0b6d7ae8 into 746a771a95ebf6184…
jmfrancois Oct 1, 2021
7d1344d
chore: yarn-deduplicate
github-actions[bot] Oct 1, 2021
229d69a
Merge branch 'master' into jmfrancois/chore/update-redux
sgangnant Oct 7, 2021
24001a1
Add missing registry
sgangnant Oct 20, 2021
6904765
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Nov 23, 2021
99bc2ae
Merge 69047655ccac02c92cf34d1c36a14269d39537fc into c0d9c2c30acbc2594…
jmfrancois Nov 23, 2021
839f95b
chore: yarn-deduplicate
github-actions[bot] Nov 23, 2021
cb0605c
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Nov 23, 2021
df0a8c1
chore: dedup
jmfrancois Nov 23, 2021
8081b36
chore: align redux deps of designer
jmfrancois Nov 23, 2021
dc7b5f4
test: fix new tests
jmfrancois Nov 24, 2021
8a26b65
test: update snap
jmfrancois Nov 24, 2021
015f64a
fix(CMF/Inject): make it useContext
jmfrancois Dec 3, 2021
32680f0
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 7, 2021
ac25070
test: fix Inject
jmfrancois Dec 7, 2021
33007b9
fix(playground): add ds in copyconfig
jmfrancois Dec 8, 2021
8284fe7
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 8, 2021
057a783
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 8, 2021
bb75df2
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 10, 2021
b7edfed
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 17, 2021
0237273
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 20, 2021
25fe70e
chore: adjust size
jmfrancois Dec 21, 2021
839eaba
chore: revert size.json
jmfrancois Dec 21, 2021
90c81d1
chore: try to fix ci
jmfrancois Dec 21, 2021
49271f5
chore: revert size
jmfrancois Dec 21, 2021
d4cd0aa
chore: adjust
jmfrancois Dec 21, 2021
5338252
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 24, 2021
1d757f0
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Dec 24, 2021
e5642f3
chore(ARCH-404): CI size
jmfrancois Dec 24, 2021
9608531
Merge e5642f3e0c6e8102109cb80e6979aec89d32f0e7 into be49e5d63adcf6961…
jmfrancois Dec 24, 2021
c9c25b8
chore: update size
github-actions[bot] Dec 24, 2021
c1101a6
chore: cleanup
jmfrancois Dec 24, 2021
601bd20
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Jan 10, 2022
2743d14
Merge 601bd2060b8bdf28cebc3a66c3a277e1b85b6928 into 8b6e69f074b0c8b54…
jmfrancois Jan 10, 2022
5bc2f1c
chore: yarn-deduplicate
github-actions[bot] Jan 10, 2022
d01a09c
chore(changeset): add react-flow-designer
jmfrancois Jan 10, 2022
83e824a
fix(cmf): upgrade Dispatcher and update tests
jmfrancois Jan 10, 2022
ad52fa8
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Jan 11, 2022
ebea861
Update packages/cmf/__tests__/Inject.test.js
jmfrancois Jan 11, 2022
e64b4fd
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Jan 11, 2022
96a5b58
Update packages/cmf/__tests__/cmfModule.merge.test.js
jmfrancois Jan 11, 2022
3ed3ea0
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Jan 11, 2022
e7a7a76
Update packages/containers/src/ConfirmDialog/ConfirmDialog.container.js
jmfrancois Jan 11, 2022
6d9dac3
Update packages/containers/src/GuidedTour/GuidedTour.sagas.test.js
jmfrancois Jan 11, 2022
10f9417
Merge branch 'jmfrancois/chore/update-redux' of github.com:Talend/ui …
jmfrancois Jan 11, 2022
16227b6
chore: fix changeset
jmfrancois Jan 11, 2022
bd2e3df
fix: cmfConnect use hook to get store
jmfrancois Jan 11, 2022
4f27a1f
fix: cmfConnect
jmfrancois Jan 11, 2022
47d0d34
chore: cleanup
jmfrancois Jan 11, 2022
2a45270
feat: add forwardRef option support
jmfrancois Jan 12, 2022
0350691
Merge branch 'master' into jmfrancois/chore/update-redux
jmfrancois Jan 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/modern-cars-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@talend/react-cmf': major
'@talend/react-cmf-cqrs': major
'@talend/react-cmf-router': major
'@talend/react-forms': major
'@talend/react-containers': major
'@talend/react-datagrid': major
'@talend/react-sagas': major
'@talend/react-stepper': major
'@talend/react-storybook-cmf': major
'react-flow-designer': major
---

Redux major upgrade with saga
4 changes: 4 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

- name: Use Node.js 14
uses: actions/setup-node@v2
Expand Down Expand Up @@ -60,3 +63,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: "chore: apply prettier on modified files"
branch: ${{ github.head_ref }}
10 changes: 5 additions & 5 deletions .github/workflows/yarn-deduplicate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: yarn-deduplicate
on:
pull_request:
paths:
- 'yarn.lock'
- "yarn.lock"

jobs:
dedupe:
Expand All @@ -22,9 +22,9 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org/'
scope: '@talend'
cache: 'yarn'
registry-url: "https://registry.npmjs.org/"
scope: "@talend"
cache: "yarn"

- name: yarn-deduplicate
id: deduplicate
Expand All @@ -38,5 +38,5 @@ jobs:
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'chore: yarn-deduplicate'
message: "chore: yarn-deduplicate"
branch: ${{ github.head_ref }}
2 changes: 1 addition & 1 deletion packages/cmf-cqrs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@talend/react-cmf": "^6.38.5",
"immutable": "^3.8.2",
"redux-saga": "^0.15.6"
"redux-saga": "^1.1.3"
},
"devDependencies": {
"@talend/scripts-core": "^11.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Container ACKDispatcher', () => {
}

registry['actionCreator:myActionCreator'] = myActionCreator;
mount(<Container acks={Map()} />, { context: { registry } });
mount(<Container acks={Map()} />, mock.Provider.getEnzymeOption({ registry }));
expect(mockProcessACK).toHaveBeenCalled();
});
it('should processACK call dispatch', () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/cmf-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
"lodash": "^4.17.21",
"path-to-regexp": "^2.4.0",
"prop-types": "^15.8.1",
"react-redux": "^5.1.2",
"react-redux": "^7.2.2",
"react-router": "^3.2.6",
"react-router-redux": "^4.0.8",
"redux-saga": "^0.15.6"
"redux-saga": "^1.1.3"
},
"peerDependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"devDependencies": {
"@redux-saga/testing-utils": "^1.1.3",
"@talend/scripts-core": "^11.3.0",
"@talend/scripts-preset-react-lib": "^9.9.3",
"enzyme": "^3.11.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cmf-router/src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('getModule', () => {
const generator = mod.cmfModule.saga();
generator.next();
const result = generator.next();
expect(result.value.FORK.args[1]).toEqual({
expect(result.value.payload.args[1]).toEqual({
'/foo': config.sagaRouterConfig['/foo'],
'/foo/bar': configBis.sagaRouterConfig['/foo/bar'],
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cmf-router/src/sagaRouter.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { spawn, take, cancel } from 'redux-saga/effects';
import { createMockTask } from 'redux-saga/utils';
import { createMockTask } from '@redux-saga/testing-utils';
import sagaRouter from './sagaRouter';

describe('sagaRouter import', () => {
Expand Down
62 changes: 23 additions & 39 deletions packages/cmf/__tests__/Dispatcher.test.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import React from 'react';
import PropTypes from 'prop-types';
import { shallow, mount } from 'enzyme';
import { Dispatcher } from '../src/Dispatcher';
import CONST from '../src/constant';
import { RegistryProvider } from '../src/RegistryProvider';

const mockContext = {
registry: {
[`${CONST.REGISTRY_ACTION_CREATOR_PREFIX}:actionCreator:id`]: jest.fn(),
[`${CONST.REGISTRY_ACTION_CREATOR_PREFIX}:another:actionCreator:id`]: jest.fn(),
},
const REGISTRY = {
[`${CONST.REGISTRY_ACTION_CREATOR_PREFIX}:actionCreator:id`]: jest.fn(),
[`${CONST.REGISTRY_ACTION_CREATOR_PREFIX}:another:actionCreator:id`]: jest.fn(),
};

function getEnzymeOption() {
return {
wrappingComponent: RegistryProvider,
wrappingComponentProps: { value: REGISTRY },
};
}

jest.mock('../src/action', () => ({
getOnProps() {
return ['onClick', 'onDoubleClick'];
Expand Down Expand Up @@ -49,9 +54,7 @@ describe('Testing <Dispatcher />', () => {
>
<button />
</Dispatcher>,
{
context: mockContext,
},
getEnzymeOption(),
);
expect(
JSON.stringify(wrapper.find('button').props(), replacer).replace(/(\\t|\\n)/g, ''),
Expand All @@ -70,9 +73,7 @@ describe('Testing <Dispatcher />', () => {
>
<button />
</Dispatcher>,
{
context: mockContext,
},
getEnzymeOption(),
);
}).toThrow('action not found id: unknnown:actionCreator:id');
});
Expand All @@ -82,9 +83,7 @@ describe('Testing <Dispatcher />', () => {
<Dispatcher onClick="noOp" onDoubleClick="noOp">
<button />
</Dispatcher>,
{
context: mockContext,
},
getEnzymeOption(),
);
const buttonWrapper = wrapper.find('button').at(0);
const instance = wrapper.instance();
Expand All @@ -103,9 +102,7 @@ describe('Testing <Dispatcher />', () => {
<Dispatcher onClick="error:actionCreator:id" onDoubleClick="another:actionCreator:id">
<button />
</Dispatcher>,
{
context: mockContext,
},
getEnzymeOption(),
);
}).toThrowError('action not found id: error:actionCreator:id');
},
Expand All @@ -119,9 +116,7 @@ describe('Testing <Dispatcher />', () => {
<Dispatcher onClick="existingActionCreator:id" onDoubleClick="existingActionCreator:id">
<button />
</Dispatcher>,
{
context: mockContext,
},
getEnzymeOption(),
);
expect(() => {
wrapper.setProps({ onClick: 'error:another:actionCreator:id' });
Expand All @@ -142,12 +137,7 @@ describe('Testing <Dispatcher />', () => {
<a />
</Dispatcher>
</div>,
{
context: mockContext,
childContextTypes: {
registry: PropTypes.object.isRequired,
},
},
getEnzymeOption(),
);
wrapper.find('a').simulate('click');
expect(onClick).toHaveBeenCalled();
Expand All @@ -167,12 +157,7 @@ describe('Testing <Dispatcher />', () => {
<a />
</Dispatcher>
</div>,
{
context: mockContext,
childContextTypes: {
registry: PropTypes.object.isRequired,
},
},
getEnzymeOption(),
);
wrapper.find('a').simulate('click');
expect(onClick).not.toHaveBeenCalled();
Expand All @@ -188,9 +173,7 @@ describe('Testing <Dispatcher />', () => {
<Dispatcher dispatchActionCreator={dispatchActionCreator} preventDefault onClick="noOp">
<a />
</Dispatcher>,
{
context: mockContext,
},
getEnzymeOption(),
);
wrapper.find('a').simulate('click', event);
expect(event.preventDefault).toHaveBeenCalled();
Expand All @@ -210,9 +193,10 @@ describe('Testing <Dispatcher />', () => {
extra: 'foo',
children: <a />,
};
const wrapper = shallow(<Dispatcher {...props} />, {
context: mockContext,
});
const wrapper = shallow(
<Dispatcher {...props} />,
getEnzymeOption(),
);
wrapper.find('a').simulate('click', event);
expect(dispatchActionCreator).toHaveBeenCalledWith('noOp', event, props);
});
Expand Down
30 changes: 19 additions & 11 deletions packages/cmf/__tests__/Inject.test.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,48 @@
import React from 'react';
import { shallow } from 'enzyme';
import { mount } from 'enzyme';

import Inject from '../src/Inject.component';
import { mock } from '../src';

describe('Inject', () => {
it('should render', () => {
// given
const MyComponent = jest.fn();
const MyComponent = jest.fn(() => <span>Hello</span>);
MyComponent.displayName = 'MyComponent';
const context = {
registry: {
'_.route.component:MyComponent': MyComponent,
},
};
const Provider = mock.Provider;

// when
const wrapper = shallow(<Inject component="MyComponent" extra-props />, { context });
const wrapper = mount(
<Inject component="MyComponent" extra-props />,
Provider.getEnzymeOption(context),
);

// then
expect(wrapper.equals(<MyComponent extra-props />)).toBe(true);
expect(wrapper.find(MyComponent).equals(<MyComponent extra-props />)).toBe(true);
});

it('should render error if component not found', () => {
// given
const MyComponent = jest.fn();
MyComponent.displayName = 'MyComponent';
const context = { registry: {} };
// const context = { registry: {} };
jmfrancois marked this conversation as resolved.
Show resolved Hide resolved
const Provider = mock.Provider;

// when
const wrapper = shallow(<Inject component="MyComponent" />, { context });
const wrapper = mount(<Inject component="MyComponent" />, Provider.getEnzymeOption());

// then
expect(wrapper.equals(
<Inject.NotFoundComponent
error="component not found in the registry: MyComponent"
/>
)).toBe(true);
expect(
wrapper
.find(Inject.NotFoundComponent)
.equals(
<Inject.NotFoundComponent error="component not found in the registry: MyComponent" />,
),
).toBe(true);
});
});
10 changes: 5 additions & 5 deletions packages/cmf/__tests__/action.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import actionAPI from '../src/action';
import mock from '../src/mock';
import {mock} from '../src';
jmfrancois marked this conversation as resolved.
Show resolved Hide resolved

describe('CMF action', () => {
let state;
Expand All @@ -8,11 +8,11 @@ describe('CMF action', () => {
let settings;

beforeEach(() => {
settings = mock.settings();
state = mock.state();
settings = mock.store.settings();
state = mock.store.state();
state.cmf.settings = settings;
context = mock.context(state);
emptyContext = mock.emptyContext();
context = mock.store.context(state);
emptyContext = mock.store.emptyContext();
});
it('getActionsById should return action from settings', () => {
const actions = actionAPI.getActionsById(context);
Expand Down
5 changes: 2 additions & 3 deletions packages/cmf/__tests__/actionCreator.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import mock from '../src/mock';
import {mock} from '../src';
jmfrancois marked this conversation as resolved.
Show resolved Hide resolved
import actionCreatorAPI from '../src/actionCreator';
import { create } from 'domain';

describe('CMF action', () => {
let context;

beforeEach(() => {
context = mock.context();
context = mock.store.context();
});

it('get should return a function', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/cmf/__tests__/bootstrap.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jest.mock('../src/onError', () => ({
}));
jest.mock('../src/registry', () => ({
registerMany: jest.fn(),
getRegistry: jest.fn(),
}));
jest.mock('../src/actionCreator', () => ({
registerMany: jest.fn(),
Expand Down
Loading