diff --git a/dev/docker-compose.dev.full.test.yml b/dev/docker-compose.dev.full.test.yml index 4c8ee0f89..1b9920bde 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 fa669b6ce..5073375c5 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}" REACT_APP_RECAPTCHA_SITE_KEY: "${REACT_APP_RECAPTCHA_SITE_KEY}" + REACT_APP_DATA_DICTIONARY_LINK: "${REACT_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 f1333e533..480f31d21 100644 --- a/dev/docker-compose.dev.yml +++ b/dev/docker-compose.dev.yml @@ -36,3 +36,4 @@ services: REACT_APP_COOKIE_CONSENT_PUBLIC_ID: "${REACT_APP_COOKIE_CONSENT_PUBLIC_ID}" REACT_APP_RECAPTCHA_SITE_KEY: "${REACT_APP_RECAPTCHA_SITE_KEY}" REACT_APP_DISEASE_NAME: "${REACT_APP_DISEASE_NAME}" + REACT_APP_DATA_DICTIONARY_LINK: "${REACT_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 4c0f378de..785c03246 100644 --- a/verification/curator-service/ui/src/components/App/App.test.tsx +++ b/verification/curator-service/ui/src/components/App/App.test.tsx @@ -9,12 +9,17 @@ import { Role } from '../../api/models/User'; jest.mock('axios'); const mockedAxios = axios as jest.Mocked; +const mockedDataDictionaryLink = 'https://global.health/data-dictionary'; const env = validateEnv(); beforeEach(() => { jest.clearAllMocks(); }); +beforeAll(() => { + process.env.REACT_APP_DATA_DICTIONARY_LINK = mockedDataDictionaryLink; +}); + describe('', () => { it('renders without crashing when logged in', async () => { const axiosResponse = { @@ -129,7 +134,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 24102d7f8..42b2e65c3 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()); @@ -62,7 +66,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 61166f02d..2f990f240 100644 --- a/verification/curator-service/ui/src/components/landing-page/LandingPage.tsx +++ b/verification/curator-service/ui/src/components/landing-page/LandingPage.tsx @@ -160,7 +160,7 @@ const MoreInformationLinks = ({