From a09a0ec25125eb9025a9b2fd8c49af6779a8156f Mon Sep 17 00:00:00 2001 From: sumn2u Date: Tue, 11 Jun 2024 13:28:22 -0500 Subject: [PATCH 1/2] added test case for download button --- client/babel.config.json | 5 ++ client/config.js | 5 +- client/src/DemoSite/index.jsx | 2 +- client/src/SetupPage/index.jsx | 2 +- client/src/utils/get-data-from-server.js | 7 ++- .../DownloadButton/DownloadButton.test.js | 58 +++++++++++++++++++ 6 files changed, 72 insertions(+), 7 deletions(-) create mode 100644 client/babel.config.json create mode 100644 client/src/workspace/DownloadButton/DownloadButton.test.js diff --git a/client/babel.config.json b/client/babel.config.json new file mode 100644 index 0000000..38f5094 --- /dev/null +++ b/client/babel.config.json @@ -0,0 +1,5 @@ +{ + "presets": [ + "@babel/preset-env" + ] +} \ No newline at end of file diff --git a/client/config.js b/client/config.js index baaebd2..93c399a 100644 --- a/client/config.js +++ b/client/config.js @@ -1,7 +1,8 @@ const config = { - demoSiteUrl:"https://annotate-docs.dwaste.live/" + DEMO_SITE_URL:"https://annotate-docs.dwaste.live/", + VITE_SERVER_URL: "http://localhost:5000", }; - export default config; +export default config; \ No newline at end of file diff --git a/client/src/DemoSite/index.jsx b/client/src/DemoSite/index.jsx index fec7db8..29767ec 100644 --- a/client/src/DemoSite/index.jsx +++ b/client/src/DemoSite/index.jsx @@ -161,7 +161,7 @@ export default () => { const updatedIndex = (selectedImageIndex - 1 + imageNames.length) % imageNames.length changeSelectedImageIndex(isNaN(updatedIndex ) ? 0 : updatedIndex) }} - openDocs={() => window.open(config.demoSiteUrl, '_blank')} + openDocs={() => window.open(config.DEMO_SITE_URL, '_blank')} hideSettings={true} disabledNextAndPrev={settings.images.length <= 1} selectedImageIndex={selectedImageIndex} diff --git a/client/src/SetupPage/index.jsx b/client/src/SetupPage/index.jsx index 87c425e..54f8dd3 100644 --- a/client/src/SetupPage/index.jsx +++ b/client/src/SetupPage/index.jsx @@ -111,7 +111,7 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel}) => {