diff --git a/dev/docker-compose.dev.full.test.yml b/dev/docker-compose.dev.full.test.yml index a7f1bddb8..46e2bf35b 100644 --- a/dev/docker-compose.dev.full.test.yml +++ b/dev/docker-compose.dev.full.test.yml @@ -45,6 +45,7 @@ services: REACT_APP_PUBLIC_MAPBOX_TOKEN: "${REACT_APP_PUBLIC_MAPBOX_TOKEN}" REACT_APP_POLICY_PUBLIC_ID: "${REACT_APP_POLICY_PUBLIC_ID}" REACT_APP_COOKIE_CONSENT_PUBLIC_ID: "${REACT_APP_COOKIE_CONSENT_PUBLIC_ID}" + REACT_APP_DATA_DICTIONARY_LINK: "${REACT_APP_DATA_DICTIONARY_LINK}" ENABLE_LOCAL_AUTH: "true" localstack: image: localstack/localstack-pro diff --git a/dev/docker-compose.dev.full.yml b/dev/docker-compose.dev.full.yml index f3a8ed538..716892542 100644 --- a/dev/docker-compose.dev.full.yml +++ b/dev/docker-compose.dev.full.yml @@ -51,6 +51,7 @@ services: REACT_APP_POLICY_PUBLIC_ID: "${REACT_APP_POLICY_PUBLIC_ID}" REACT_APP_COOKIE_CONSENT_PUBLIC_ID: "${REACT_APP_COOKIE_CONSENT_PUBLIC_ID}" VITE_APP_RECAPTCHA_SITE_KEY: "${VITE_APP_RECAPTCHA_SITE_KEY}" + VITE_APP_DATA_DICTIONARY_LINK: "${VITE_APP_DATA_DICTIONARY_LINK}" ENABLE_LOCAL_AUTH: "true" DISEASE_NAME: "${DISEASE_NAME}" localstack: diff --git a/dev/docker-compose.dev.yml b/dev/docker-compose.dev.yml index 7657bbe1b..d908e1599 100644 --- a/dev/docker-compose.dev.yml +++ b/dev/docker-compose.dev.yml @@ -36,3 +36,4 @@ services: VITE_APP_COOKIE_CONSENT_PUBLIC_ID: "${REACT_APP_COOKIE_CONSENT_PUBLIC_ID}" VITE_APP_RECAPTCHA_SITE_KEY: "${VITE_APP_RECAPTCHA_SITE_KEY}" VITE_APP_DISEASE_NAME: "${REACT_APP_DISEASE_NAME}" + VITE_APP_DATA_DICTIONARY_LINK: "${VITE_APP_DATA_DICTIONARY_LINK}" diff --git a/verification/curator-service/ui/src/components/App/App.test.tsx b/verification/curator-service/ui/src/components/App/App.test.tsx index 99d58b5db..00fe5f4be 100644 --- a/verification/curator-service/ui/src/components/App/App.test.tsx +++ b/verification/curator-service/ui/src/components/App/App.test.tsx @@ -8,6 +8,8 @@ import { MapLink } from '../../constants/types'; import validateEnv from '../../util/validate-env'; import { Role } from '../../api/models/User'; +const mockedDataDictionaryLink = 'https://global.health/data-dictionary'; + const env = validateEnv(); beforeAll(() => { @@ -22,6 +24,10 @@ beforeEach(() => { vi.clearAllMocks(); }); +beforeAll(() => { + process.env.VITE_APP_DATA_DICTIONARY_LINK = mockedDataDictionaryLink; +}); + describe('', () => { it('renders without crashing when logged in', async () => { const axiosResponse = { @@ -136,7 +142,7 @@ describe('', () => { ); expect(await screen.findByTestId('dictionaryButton')).toHaveAttribute( 'href', - 'https://raw.githubusercontent.com/globaldothealth/list/main/data-serving/scripts/export-data/data_dictionary.txt', + mockedDataDictionaryLink, ); expect(await screen.findByTestId('termsButton')).toHaveAttribute( 'href', diff --git a/verification/curator-service/ui/src/components/App/index.tsx b/verification/curator-service/ui/src/components/App/index.tsx index d1525a1f6..489ab4224 100644 --- a/verification/curator-service/ui/src/components/App/index.tsx +++ b/verification/curator-service/ui/src/components/App/index.tsx @@ -218,7 +218,7 @@ function ProfileMenu(props: { user: User; version: string }): JSX.Element { diff --git a/verification/curator-service/ui/src/components/DownloadButton/index.tsx b/verification/curator-service/ui/src/components/DownloadButton/index.tsx index cfb65c59c..2e05b2874 100644 --- a/verification/curator-service/ui/src/components/DownloadButton/index.tsx +++ b/verification/curator-service/ui/src/components/DownloadButton/index.tsx @@ -249,7 +249,7 @@ export function DownloadButton(): JSX.Element { diff --git a/verification/curator-service/ui/src/components/Footer/index.tsx b/verification/curator-service/ui/src/components/Footer/index.tsx index 137972c18..a03501f7e 100644 --- a/verification/curator-service/ui/src/components/Footer/index.tsx +++ b/verification/curator-service/ui/src/components/Footer/index.tsx @@ -62,7 +62,7 @@ const Footer = ({ drawerOpen }: FooterProps): JSX.Element => {
server.listen()); +beforeAll(() => { + server.listen(); + process.env.REACT_APP_DATA_DICTIONARY_LINK = mockedDataDictionaryLink; +}); afterEach(() => server.resetHandlers()); afterAll(() => server.close()); @@ -63,7 +67,7 @@ describe('', () => { ); expect(screen.getByText('Data dictionary')).toHaveAttribute( 'href', - 'https://raw.githubusercontent.com/globaldothealth/list/main/data-serving/scripts/export-data/data_dictionary.txt', + mockedDataDictionaryLink, ); expect(screen.getByText('Terms of use')).toHaveAttribute( 'href', diff --git a/verification/curator-service/ui/src/components/landing-page/LandingPage.tsx b/verification/curator-service/ui/src/components/landing-page/LandingPage.tsx index 37155e5a8..d7082ca84 100644 --- a/verification/curator-service/ui/src/components/landing-page/LandingPage.tsx +++ b/verification/curator-service/ui/src/components/landing-page/LandingPage.tsx @@ -155,7 +155,7 @@ const MoreInformationLinks = ({