From 2479694dc887f3e945d7624b08815a6e126cc439 Mon Sep 17 00:00:00 2001 From: Yoan VALLET <ext.sopra.yvallet@grandlyon.com> Date: Wed, 18 Nov 2020 19:38:02 +0100 Subject: [PATCH] feat: move cozy bar config --- jest.config.js | 9 +-------- src/components/Header/CozyBar.spec.tsx | 2 +- test/jestLib/setup.js | 9 +++++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/jest.config.js b/jest.config.js index 676221f66..73b4f7962 100644 --- a/jest.config.js +++ b/jest.config.js @@ -18,13 +18,6 @@ module.exports = { globals: { __ALLOW_HTTP__: false, __TARGET__: 'browser', - cozy: { - bar: { - BarLeft: ({ children }) => children, - BarRight: ({ children }) => children, - BarCenter: ({ children }) => children, - setTheme: () => null, - }, - }, + cozy: {}, } } diff --git a/src/components/Header/CozyBar.spec.tsx b/src/components/Header/CozyBar.spec.tsx index 35489f78c..068242c90 100644 --- a/src/components/Header/CozyBar.spec.tsx +++ b/src/components/Header/CozyBar.spec.tsx @@ -34,7 +34,7 @@ describe('CozyBar component', () => { it('should call handleClickFeedbacks', () => { useRecoilValue.mockReturnValueOnce(ScreenType.MOBILE) - useSetRecoilState.mockReturnValueOnce((t: ModalState) => t) + useSetRecoilState.mockReturnValueOnce((value: ModalState) => value) const component = shallow(<CozyBar />) component.find(StyledIconButton).simulate('click') expect(useSetRecoilState).toBeCalled() diff --git a/test/jestLib/setup.js b/test/jestLib/setup.js index add18abe4..b6deccdf3 100644 --- a/test/jestLib/setup.js +++ b/test/jestLib/setup.js @@ -11,3 +11,12 @@ configure({ adapter: new Adapter() }) global.requestAnimationFrame = cb => { setTimeout(cb, 0) } + +global.cozy = { + bar: { + BarLeft: ({ children }) => children, + BarRight: ({ children }) => children, + BarCenter: ({ children }) => children, + setTheme: () => null, + }, +} -- GitLab