diff --git a/README.md b/README.md index 59842189..ce5aa916 100644 --- a/README.md +++ b/README.md @@ -39,17 +39,17 @@ See https://git-scm.com/downloads for instructions. ### Step 2: Install Node.js -_Node.js version 16.x works best for now; later versions have exhibited some strange behaviour with this project. +_Node.js version 18.x works best for now; later versions have exhibited some strange behaviour with this project. If you encounter issues with the server, check your version of Node.js first. This includes CORS related issues when fetching the API._ We recommend using [nvm](https://github.com/nvm-sh/nvm) to install and manage your Node.js instances. More details here: https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/ 1. Make sure a profile exists for your terminal, run `touch ~/.profile; touch ~/.zshrc` 2. Install nvm: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash` -3. Install the latest version of Node.js 16: `nvm install 16` -4. Use the installed Node.js: `nvm use 16` +3. Install the latest version of Node.js 18: `nvm install 18` +4. Use the installed Node.js: `nvm use 18` -Alternatively, you can install Node.js directly from https://nodejs.org/dist/latest-v16.x/ +Alternatively, you can install Node.js directly from https://nodejs.org/dist/latest-v18.x/ _On MacOS, you can alleviate the need to run as sudo by using nvm or by [following John Papa's instructions](http://jpapa.me/nomoresudo)._ @@ -82,10 +82,15 @@ REACT_APP_API_ROOT=http://localhost:3000 ### Step 5: Install npm dependencies +_option_ + ``` npm install ``` +_For Legacy dependencies run_ - +**`npm install --legacy-peer-deps`** + ### Step 6: Start the client ``` @@ -227,10 +232,26 @@ We follow the React/Jest convention for writng tests. All test file are located Please ensure that at least all the _model_ unit tests under `./src/model/` pass. -To run tests: +Some components test are also located under _tests_ under `./src/components/tests` + +Contains mock data and utilities used across tests `./src/testMocks` + +``` +Current Test Stats +Total Tests: 108 + +Framework: Jest + +Environment: React 18.x / Babel-Jest +``` + +To run tests: `npm test` +To run a single test: +`npm test -- xxx.test.js` + ### Cypress Make your own `/cypress/fixtures/login.json` file containing the actual credentials in order to run the cypress tests. diff --git a/src/components/Verify.js b/src/components/Verify.js index 101bc294..b3ef30d2 100644 --- a/src/components/Verify.js +++ b/src/components/Verify.js @@ -238,7 +238,7 @@ const Verify = (props) => { e.stopPropagation(); e.preventDefault(); log.debug('click on capture pin:%d', captureId); - const url = `${process.env.REACT_APP_WEBMAP_DOMAIN}/?treeid=${captureId}`; + const url = `${process.env.REACT_APP_WEBMAP_DOMAIN}/trees/${captureId}`; window.open(url, '_blank').opener = null; } @@ -246,7 +246,7 @@ const Verify = (props) => { e.stopPropagation(); e.preventDefault(); log.debug('click on grower:%d', growerId); - const url = `${process.env.REACT_APP_WEBMAP_DOMAIN}/?userid=${growerId}`; + const url = `${process.env.REACT_APP_WEBMAP_DOMAIN}/planters/${growerId}`; window.open(url, '_blank').opener = null; } @@ -480,7 +480,8 @@ const Verify = (props) => { handleCapturePinClick(e, capture.id)} aria-label={`Capture location`} @@ -490,7 +491,8 @@ const Verify = (props) => { handleGrowerMapClick(e, capture.planterId)