diff --git a/__mocks__/utils.mock.ts b/__mocks__/utils.mock.ts index db3cb4975..31161b76a 100644 --- a/__mocks__/utils.mock.ts +++ b/__mocks__/utils.mock.ts @@ -1,3 +1,6 @@ import { TextEncoder, TextDecoder } from 'util' Object.assign(global, { TextDecoder, TextEncoder }) + +// for testing locally comment. +// process.env.AUTH_DISABLED= "true" diff --git a/__tests__/pages/privacy-notice-terms-conditions.test.js b/__tests__/pages/privacy-notice-terms-conditions.test.js deleted file mode 100644 index 701dcd63f..000000000 --- a/__tests__/pages/privacy-notice-terms-conditions.test.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @jest-environment jsdom - */ -import { render, screen } from '@testing-library/react' -import '@testing-library/jest-dom' -import PrivacyCondition from '../../pages/privacy-notice-terms-conditions' - -import { useRouter } from 'next/router' - -// mocks useRouter to be able to use component' router.asPath -jest.mock('next/router', () => ({ - useRouter: jest.fn(), -})) - -// mocks useRouter to be able to use component' router.asPath -jest.mock('../../lib/auth', () => ({ - AuthIsDisabled: () => { - return true - }, - AuthIsValid: () => { - return true - }, - Redirect: jest.fn(), -})) - -describe('Privacy Notice Terms Conditions page', () => { - const content = { - id: 'privacy-notice-terms-conditions', - breadcrumb: [ - { link: 'my-dashboard', text: 'My dashboard', id: 'my-dashboard' }, - ], - pageName: 'privacy-notice-terms-conditions', - heading: 'Privacy notice and terms and conditions', - alert: { - type: 'info', - text: 'You may wish to print this page for future reference since it contains important information.\n', - }, - content: - 'testing ## Terms and conditions of use testing 1. **Your credentials** testing', - } - const contentFr = { - id: 'privacy-notice-terms-conditions', - breadcrumb: [ - { - link: 'mon-tableau-de-bord', - text: 'Mon tableau de bord', - id: 'my-dashboard', - }, - ], - pageName: 'avis-confidentialite-modalites', - heading: 'Avis de confidentialité et modalités', - alert: { - type: 'info', - text: - 'Vous pouvez imprimer cette page pour vous y référer ultérieurement car elle contient des informations importantes.\n' + - '\n' + - ' ', - }, - content: - 'testing ## Conditions d’utilisation testing 1. **Vos identifiants** testing', - } - const popupContent = {} - - beforeEach(() => { - useRouter.mockImplementation(() => ({ - pathname: '/', - asPath: '/', - })) - }) - - it('should render the page in English', () => { - render( - - ) - const PrivacyConditionDiv = screen.getByTestId( - 'terms-conditionsContent-test' - ) - expect(PrivacyConditionDiv).toBeInTheDocument() - }) - - it('should render the page in French', () => { - render( - - ) - const PrivacyConditionDiv = screen.getByTestId( - 'terms-conditionsContent-test' - ) - expect(PrivacyConditionDiv).toBeInTheDocument() - }) -}) diff --git a/components/Layout.js b/components/Layout.js index b1ca62d9e..c31dbef64 100644 --- a/components/Layout.js +++ b/components/Layout.js @@ -147,24 +147,45 @@ export default function Layout(props) { -