Skip to content
Snippets Groups Projects
Commit 2479694d authored by Yoan VALLET's avatar Yoan VALLET
Browse files

feat: move cozy bar config

parent 9213c0a6
Branches
Tags
1 merge request!139Features/unit tests
...@@ -18,13 +18,6 @@ module.exports = { ...@@ -18,13 +18,6 @@ module.exports = {
globals: { globals: {
__ALLOW_HTTP__: false, __ALLOW_HTTP__: false,
__TARGET__: 'browser', __TARGET__: 'browser',
cozy: { cozy: {},
bar: {
BarLeft: ({ children }) => children,
BarRight: ({ children }) => children,
BarCenter: ({ children }) => children,
setTheme: () => null,
},
},
} }
} }
...@@ -34,7 +34,7 @@ describe('CozyBar component', () => { ...@@ -34,7 +34,7 @@ describe('CozyBar component', () => {
it('should call handleClickFeedbacks', () => { it('should call handleClickFeedbacks', () => {
useRecoilValue.mockReturnValueOnce(ScreenType.MOBILE) useRecoilValue.mockReturnValueOnce(ScreenType.MOBILE)
useSetRecoilState.mockReturnValueOnce((t: ModalState) => t) useSetRecoilState.mockReturnValueOnce((value: ModalState) => value)
const component = shallow(<CozyBar />) const component = shallow(<CozyBar />)
component.find(StyledIconButton).simulate('click') component.find(StyledIconButton).simulate('click')
expect(useSetRecoilState).toBeCalled() expect(useSetRecoilState).toBeCalled()
......
...@@ -11,3 +11,12 @@ configure({ adapter: new Adapter() }) ...@@ -11,3 +11,12 @@ configure({ adapter: new Adapter() })
global.requestAnimationFrame = cb => { global.requestAnimationFrame = cb => {
setTimeout(cb, 0) setTimeout(cb, 0)
} }
global.cozy = {
bar: {
BarLeft: ({ children }) => children,
BarRight: ({ children }) => children,
BarCenter: ({ children }) => children,
setTheme: () => null,
},
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment