diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..89b170c62 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,8 @@ + +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' + +template: | + ## Changes + + $CHANGES + diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 000000000..0da5221d5 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,24 @@ +name: Release Drafter + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + update_release_draft: + runs-on: ubuntu-latest + permissions: + # Write permission is required to create a github release + contents: write + # Write permission is required for autolabeler + pull-requests: write + steps: + - uses: release-drafter/release-drafter@v6 + with: + name: next + tag: next + version: next + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index 0edd809e5..000000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,13 +0,0 @@ -on: - push: - branches: - - main -name: release-please -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3.1.2 - with: - release-type: node - package-name: release-please-action \ No newline at end of file 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 8fcd17852..1cf618ea9 100644 --- a/components/Layout.js +++ b/components/Layout.js @@ -199,25 +199,45 @@ export default function Layout(props) { refPageAA={props.refPageAA} /> -