diff --git a/src/__mocks__/react-i18next.js b/src/__mocks__/react-i18next.js index 14d998c..8a297ab 100644 --- a/src/__mocks__/react-i18next.js +++ b/src/__mocks__/react-i18next.js @@ -1,6 +1,8 @@ const reactI18next = jest.requireActual('react-i18next'); +const i18n = require('i18n'); module.exports = { ...reactI18next, - Trans: require('__mocks__/component-mock').buildMock(reactI18next.Trans) + Trans: require('__mocks__/component-mock').buildMock(reactI18next.Trans), + useTranslation: () => ({ i18n, t: i18n.mockT }) }; diff --git a/src/components/App/__snapshots__/test.js.snap b/src/components/App/__snapshots__/test.js.snap index 57e33f4..97996f0 100644 --- a/src/components/App/__snapshots__/test.js.snap +++ b/src/components/App/__snapshots__/test.js.snap @@ -3,7 +3,7 @@ exports[`App removing rendered expression 1`] = ` @@ -36,7 +36,7 @@ exports[`App removing rendered expression 1`] = ` exports[`App removing rendered expression 2`] = ` @@ -128,7 +128,7 @@ exports[`App rendering an expression 2`] = ` exports[`App rendering an expression 3`] = ` @@ -161,7 +161,7 @@ exports[`App rendering an expression 3`] = ` exports[`App rendering with an invalid syntax 1`] = ` @@ -209,7 +209,7 @@ exports[`App rendering with an invalid syntax 2`] = ` exports[`App rendering with an invalid syntax 3`] = ` ( -
+export const Footer = ({ buildId }) => { + const { t } = useTranslation(); + + return -); +
; +}; Footer.propTypes = { - t: PropTypes.func.isRequired, buildId: PropTypes.string.isRequired }; -export default withTranslation()(Footer); +export default Footer; diff --git a/src/components/Footer/test.js b/src/components/Footer/test.js index 2e7bf3a..b03b529 100644 --- a/src/components/Footer/test.js +++ b/src/components/Footer/test.js @@ -1,13 +1,12 @@ import React from 'react'; import { render } from 'react-testing-library'; -import { mockT } from 'i18n'; -import { Footer } from 'components/Footer'; +import Footer from 'components/Footer'; describe('Footer', () => { test('rendering', () => { const { asFragment } = render( -