Newer
Older
import DataShareConsentContent from './DataShareConsentContent'
import { profileData } from '../../../tests/__mocks__/profile.mock'
import configureStore from 'redux-mock-store'
import { Provider } from 'react-redux'
jest.mock('cozy-ui/transpiled/react/I18n', () => {
return {
useI18n: jest.fn(() => {
return {
t: (str: string) => str,
}
}),
}
})
const mockStore = configureStore([])
describe('DataShareConsentContent component', () => {
it('should be rendered correctly with first connexion text', () => {
const store = mockStore({
ecolyo: {
profile: profileData,
},
})
const component = mount(
<Provider store={store}>
)
expect(toJson(component)).toMatchSnapshot()
it('should be rendered correctly without first connexion text', () => {
profileData.isFirstConnection = false
const store = mockStore({
ecolyo: {
profile: profileData,
},
})
const component = mount(
<Provider store={store}>
expect(toJson(component)).toMatchSnapshot()