diff --git a/Dockerfile b/Dockerfile index b5801f0e3..070b68fcc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.16.0-alpine3.20 AS base +FROM node:20.17.0-alpine3.20 AS base WORKDIR /base COPY package*.json ./ RUN npm ci && npm cache clean --force @@ -11,6 +11,8 @@ ARG HOSTALIAS_CERT ENV HOSTALIAS_CERT=$HOSTALIAS_CERT ARG HOSTALIAS_ROOT_CERT ENV HOSTALIAS_ROOT_CERT=$HOSTALIAS_ROOT_CERT +ARG AUTH_ECAS_CA +ENV AUTH_ECAS_CA=$AUTH_ECAS_CA ARG LOGGING_LEVEL=info ENV LOGGING_LEVEL=$LOGGING_LEVEL ARG AEM_GRAPHQL_ENDPOINT=https://www.canada.ca/graphql/execute.json/decd-endc/ @@ -34,6 +36,11 @@ sed 's/\\n/\n/g' | \ xargs > \ /usr/local/share/ca-certificates/env.crt && \ chmod 644 /usr/local/share/ca-certificates/env.crt && \ +echo ${AUTH_ECAS_CA} | \ +sed 's/\\n/\n/g' | \ +xargs > \ +/usr/local/share/ca-certificates/ecas_env.crt && \ +chmod 644 /usr/local/share/ca-certificates/ecas_env.crt && \ mkdir -p /etc/ssl/certs/ && \ echo ${HOSTALIAS_ROOT_CERT} | \ sed 's/\\n/\n/g' | \ @@ -42,7 +49,7 @@ xargs > \ chmod 644 /etc/ssl/certs/root.crt && \ npm run build -FROM node:20.16.0-alpine3.20 AS production +FROM node:20.17.0-alpine3.20 AS production ENV NODE_ENV=production ARG user=nodeuser @@ -52,6 +59,9 @@ ARG home=/srv/app ARG MSCA_NG_CERT_LOCATION=/usr/local/share/ca-certificates/env.crt ENV MSCA_NG_CERT_LOCATION=$MSCA_NG_CERT_LOCATION +ARG ECAS_CERT_LOCATION=/usr/local/share/ca-certificates/ecas_env.crt +ENV ECAS_CERT_LOCATION=$ECAS_CERT_LOCATION + RUN addgroup \ -S ${group} \ --gid 1001 && \ @@ -67,6 +77,7 @@ WORKDIR ${home} COPY --from=build /etc/ssl/certs/root.crt /etc/ssl/certs/root.crt COPY --from=build --chown=${user}:${group} /usr/local/share/ca-certificates/env.crt ${MSCA_NG_CERT_LOCATION} +COPY --from=build --chown=${user}:${group} /usr/local/share/ca-certificates/ecas_env.crt ${ECAS_CERT_LOCATION} RUN apk update && \ apk add ca-certificates && \ @@ -131,6 +142,8 @@ ENV AUTH_DISABLED=$AUTH_DISABLED ARG AUTH_ECAS_GLOBAL_LOGOUT_URL ENV AUTH_ECAS_GLOBAL_LOGOUT_URL=$AUTH_ECAS_GLOBAL_LOGOUT_URL + +ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/ecas_env.crt # ECAS/next-auth env end ARG PORT=3000 diff --git a/__tests__/components/Card.test.js b/__tests__/components/Card.test.js index 58a922488..a1e654808 100644 --- a/__tests__/components/Card.test.js +++ b/__tests__/components/Card.test.js @@ -33,4 +33,6 @@ describe('Card', () => { const results = await axe(container) expect(results).toHaveNoViolations() }) + + // TODO: Add a test that if an alert is added it actually appears }) diff --git a/__tests__/components/Layout.test.js b/__tests__/components/Layout.test.js index 467dc53a9..816e3029c 100644 --- a/__tests__/components/Layout.test.js +++ b/__tests__/components/Layout.test.js @@ -73,6 +73,10 @@ describe('Layout with default text', () => { useRouter.mockImplementation(() => ({ pathname: '/', asPath: '/', + events: { + on: jest.fn(), + off: jest.fn(), + }, })) it.skip('Layout contains Symbol of GoC', () => { diff --git a/__tests__/pages/contact-us-pages.test.js b/__tests__/pages/contact-us-pages.test.js index 7c8ae61a4..ca7632c4a 100644 --- a/__tests__/pages/contact-us-pages.test.js +++ b/__tests__/pages/contact-us-pages.test.js @@ -57,6 +57,10 @@ describe.skip('Dynamic Contact Us Page', () => { useRouter.mockImplementation(() => ({ pathname: '/', asPath: '/', + events: { + on: jest.fn(), + off: jest.fn(), + }, })) }) diff --git a/__tests__/pages/decision-reviews.test.js b/__tests__/pages/decision-reviews.test.js index 93a311dbf..f15430d65 100644 --- a/__tests__/pages/decision-reviews.test.js +++ b/__tests__/pages/decision-reviews.test.js @@ -81,6 +81,10 @@ describe('Decision Reviews page', () => { useRouter.mockImplementation(() => ({ pathname: '/', asPath: '/', + events: { + on: jest.fn(), + off: jest.fn(), + }, })) }) @@ -94,10 +98,10 @@ describe('Decision Reviews page', () => { meta={{}} breadCrumbItems={content.breadcrumb} langToggleLink={''} - /> + />, ) const DecisionReviewsDiv = screen.getByTestId( - 'decision-reviewsContent-test' + 'decision-reviewsContent-test', ) expect(DecisionReviewsDiv).toBeInTheDocument() }) @@ -112,10 +116,10 @@ describe('Decision Reviews page', () => { meta={{}} breadCrumbItems={content.breadcrumb} langToggleLink={''} - /> + />, ) const DecisionReviewsDiv = screen.getByTestId( - 'decision-reviewsContent-test' + 'decision-reviewsContent-test', ) expect(DecisionReviewsDiv).toBeInTheDocument() }) diff --git a/__tests__/pages/index.test.js b/__tests__/pages/index.test.js index 97da85f80..e1b53bc51 100644 --- a/__tests__/pages/index.test.js +++ b/__tests__/pages/index.test.js @@ -33,6 +33,10 @@ describe('index page', () => { useRouter.mockImplementation(() => ({ pathname: '/', asPath: '/', + events: { + on: jest.fn(), + off: jest.fn(), + }, })) }) diff --git a/__tests__/pages/login.test.js b/__tests__/pages/login.test.js index 14ebc0f64..d14720ae9 100644 --- a/__tests__/pages/login.test.js +++ b/__tests__/pages/login.test.js @@ -39,6 +39,10 @@ describe('login page', () => { useRouter.mockImplementation(() => ({ pathname: '/auth/login', asPath: '/auth/login', + events: { + on: jest.fn(), + off: jest.fn(), + }, })) }) diff --git a/__tests__/pages/logout.test.js b/__tests__/pages/logout.test.js index daf1b28bb..a86a06546 100644 --- a/__tests__/pages/logout.test.js +++ b/__tests__/pages/logout.test.js @@ -43,6 +43,10 @@ describe('logout page', () => { useRouter.mockImplementation(() => ({ pathname: '/auth/logout', asPath: '/auth/logout', + events: { + on: jest.fn(), + off: jest.fn(), + }, })) }) diff --git a/__tests__/pages/my-dashboard.test.js b/__tests__/pages/my-dashboard.test.js index 7cc7cebe8..b696f2a5c 100644 --- a/__tests__/pages/my-dashboard.test.js +++ b/__tests__/pages/my-dashboard.test.js @@ -65,6 +65,10 @@ describe('My Dashboard page', () => { useRouter.mockImplementation(() => ({ pathname: '/', asPath: '/', + events: { + on: jest.fn(), + off: jest.fn(), + }, })) }) diff --git a/__tests__/pages/profile.test.js b/__tests__/pages/profile.test.js index ac92db184..9d8d341b2 100644 --- a/__tests__/pages/profile.test.js +++ b/__tests__/pages/profile.test.js @@ -69,6 +69,10 @@ describe('My Profile page', () => { useRouter.mockImplementation(() => ({ pathname: '/', asPath: '/', + events: { + on: jest.fn(), + off: jest.fn(), + }, })) }) diff --git a/__tests__/pages/security-settings.test.js b/__tests__/pages/security-settings.test.js index 35f92bf94..df1f79d30 100644 --- a/__tests__/pages/security-settings.test.js +++ b/__tests__/pages/security-settings.test.js @@ -50,6 +50,10 @@ describe('Security Settings page', () => { useRouter.mockImplementation(() => ({ pathname: '/', asPath: '/', + events: { + on: jest.fn(), + off: jest.fn(), + }, })) }) @@ -63,7 +67,7 @@ describe('Security Settings page', () => { meta={{}} breadCrumbItems={content.breadcrumb} langToggleLink={''} - /> + />, ) const SecuritySettingsDiv = screen.getByTestId('securityContent-test') expect(SecuritySettingsDiv).toBeInTheDocument() @@ -79,7 +83,7 @@ describe('Security Settings page', () => { meta={{}} breadCrumbItems={content.breadcrumb} langToggleLink={''} - /> + />, ) const SecuritySettingsDiv = screen.getByTestId('securityContent-test') expect(SecuritySettingsDiv).toBeInTheDocument() @@ -95,7 +99,7 @@ describe('Security Settings page', () => { meta={{}} breadCrumbItems={content.breadcrumb} langToggleLink={''} - /> + />, ) const securityQuestionsLink = screen.getByTestId('securityQuestionsLink') expect(securityQuestionsLink).toBeInTheDocument() diff --git a/components/BackToButton.tsx b/components/BackToButton.tsx index 5623789a2..4572a1e80 100644 --- a/components/BackToButton.tsx +++ b/components/BackToButton.tsx @@ -12,8 +12,8 @@ const BackToButton = ({ buttonHref, buttonId, buttonLinkText, - refPageAA, - id, + refPageAA = 'mscaPlaceholder', + id = 'mscaPlaceholder', }: BackToButtonProps) => { return ( <> @@ -21,7 +21,7 @@ const BackToButton = ({ {buttonLinkText} diff --git a/components/BenefitTasks.tsx b/components/BenefitTasks.tsx index 40ff999c4..321e3d6ca 100644 --- a/components/BenefitTasks.tsx +++ b/components/BenefitTasks.tsx @@ -29,8 +29,8 @@ const BenefitTasks = ({ locale, taskList, dataCy, - refPageAA, - acronym, + refPageAA = 'mscaPlaceholder', + acronym = 'mscaPlaceholder', }: BenefitTasksProps) => { const newTabTaskExceptions = [ 'https://www.canada.ca/en/services/benefits/ei/employment-insurance-reporting.html', @@ -104,16 +104,4 @@ const BenefitTasks = ({ ) } - -BenefitTasks.defaultProps = { - taskList: [ - { - tasks: [ - { - icon: 'question-circle', // To ensure a value is used for FontAwesome icons - }, - ], - }, - ], -} export default BenefitTasks diff --git a/components/Breadcrumb.tsx b/components/Breadcrumb.tsx index bf0cc9ed4..d05e81e60 100644 --- a/components/Breadcrumb.tsx +++ b/components/Breadcrumb.tsx @@ -13,7 +13,11 @@ export interface BreadcrumbProps { refPageAA: string } -const Breadcrumb = ({ id, items, refPageAA }: BreadcrumbProps) => { +const Breadcrumb = ({ + id, // TODO: Provide a default value once this is actually mapped in + items, + refPageAA = 'mscaPlaceholder', +}: BreadcrumbProps) => { return (