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

feat: test for Navbar component

parent 7f3eb556
Branches
Tags
1 merge request!139Features/unit tests
'use strict'
/* eslint-env jest */
import React from 'react'
import { shallow } from 'enzyme'
import { RecoilRoot } from 'recoil'
import Navbar from 'components/Navbar/Navbar'
jest.mock('cozy-ui/transpiled/react/I18n', () => ({
useI18n: jest.fn().mockResolvedValue({
t: (str: string) => str,
}),
}))
describe('Navbar component', () => {
it('should be rendered correctly', () => {
const component = shallow(
<RecoilRoot>
<Navbar />
</RecoilRoot>
).getElement()
expect(component).toMatchSnapshot()
})
})
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Navbar component should be rendered correctly 1`] = `
<Context.Provider
value={
Object {
"current": Object {
"addTransactionMetadata": [Function],
"getGraph": [Function],
"getState": [Function],
"replaceState": [Function],
"subscribeToTransactions": [Function],
},
}
}
>
<Context.Provider
value={null}
>
<Batcher
setNotifyBatcherOfChange={[Function]}
/>
<Navbar />
</Context.Provider>
</Context.Provider>
`;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment