diff --git a/frontend/src/__tests__/App.test.js b/frontend/src/__tests__/App.test.js index c9eb964fd0..2a7b54505d 100644 --- a/frontend/src/__tests__/App.test.js +++ b/frontend/src/__tests__/App.test.js @@ -7,12 +7,7 @@ import gql from 'graphql-tag' import { UserStateProvider } from '../UserState' import App from '../App' import { I18nProvider } from '@lingui/react' -import { i18n } from '@lingui/core' -import { en } from 'make-plural/plurals' - -i18n.loadLocaleData('en', { plurals: en }) -i18n.load('en', { en: {} }) -i18n.activate('en') +import { setupI18n } from '@lingui/core' const resolvers = { Query: { @@ -69,7 +64,7 @@ describe('', () => { initialState={{ userName: null, jwt: null, tfa: null }} > - + @@ -92,7 +87,7 @@ describe('', () => { initialState={{ userName: null, jwt: null, tfa: null }} > - + ', () => { it('displays an error message', async () => { const { container, queryByText } = render( - + @@ -68,7 +63,7 @@ describe('', () => { it('displays an error message', async () => { const { container, queryByText } = render( - + @@ -97,7 +92,7 @@ describe('', () => { it('displays an error message', async () => { const { container, queryByText } = render( - + diff --git a/frontend/src/__tests__/DmarcReportPage.test.js b/frontend/src/__tests__/DmarcReportPage.test.js index 955706a919..0bc6c79a92 100644 --- a/frontend/src/__tests__/DmarcReportPage.test.js +++ b/frontend/src/__tests__/DmarcReportPage.test.js @@ -6,12 +6,7 @@ import { MockedProvider } from '@apollo/react-testing' import { DmarcReportPage } from '../DmarcReportPage' import { QUERY_DMARC_REPORT } from '../graphql/queries' import { I18nProvider } from '@lingui/react' -import { i18n } from '@lingui/core' -import { en } from 'make-plural/plurals' - -i18n.loadLocaleData('en', { plurals: en }) -i18n.load('en', { en: {} }) -i18n.activate('en') +import { setupI18n } from '@lingui/core' describe('', () => { it('renders pass icons in sub-headers correctly', async () => { @@ -65,7 +60,7 @@ describe('', () => { const { getByRole } = render( - + @@ -137,7 +132,7 @@ describe('', () => { const { getByText, getByRole } = render( - + diff --git a/frontend/src/__tests__/EmailField.test.js b/frontend/src/__tests__/EmailField.test.js index 294ddcd965..23b4bad38f 100644 --- a/frontend/src/__tests__/EmailField.test.js +++ b/frontend/src/__tests__/EmailField.test.js @@ -5,12 +5,7 @@ import { ThemeProvider, theme } from '@chakra-ui/core' import { EmailField } from '../EmailField' import { Formik } from 'formik' import { I18nProvider } from '@lingui/react' -import { i18n } from '@lingui/core' -import { en } from 'make-plural/plurals' - -i18n.loadLocaleData('en', { plurals: en }) -i18n.load('en', { en: {} }) -i18n.activate('en') +import { setupI18n } from '@lingui/core' describe('', () => { describe('when validation fails', () => { @@ -20,7 +15,7 @@ describe('', () => { }) const { getByTestId, getByText } = render( - + ', () => { beforeEach(() => (global.scrollTo = jest.fn())) @@ -16,7 +11,7 @@ describe('