From 4926aeec06715464fb6c3c3ed418760d17fda4c6 Mon Sep 17 00:00:00 2001 From: Mariah McFarlane Date: Wed, 28 Feb 2024 13:07:48 -0800 Subject: [PATCH 1/7] server access setup --- catalyst/src/.env | 1 + 1 file changed, 1 insertion(+) create mode 100644 catalyst/src/.env diff --git a/catalyst/src/.env b/catalyst/src/.env new file mode 100644 index 0000000..5de38bb --- /dev/null +++ b/catalyst/src/.env @@ -0,0 +1 @@ +DB_URI="mongodb+srv://generic:BfHqDu7M7gEyN69r@catalyst.nnmbroy.mongodb.net/ \ No newline at end of file From 7f6b6460f2f3d6977cd82e218ee15070db974469 Mon Sep 17 00:00:00 2001 From: Mariah McFarlane Date: Mon, 25 Mar 2024 13:38:52 -0700 Subject: [PATCH 2/7] server access setup --- catalyst/package-lock.json | 556 ++++++++++++++++++++++++++++++++++++- catalyst/package.json | 10 + catalyst/src/.env | 4 +- 3 files changed, 559 insertions(+), 11 deletions(-) diff --git a/catalyst/package-lock.json b/catalyst/package-lock.json index 7f9f146..ba9a543 100644 --- a/catalyst/package-lock.json +++ b/catalyst/package-lock.json @@ -11,10 +11,20 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.6.8", + "bcryptjs": "^2.4.3", + "concurrently": "^8.2.2", + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "jsonwebtoken": "^9.0.2", + "mongoose": "^8.2.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", "web-vitals": "^2.1.4" + }, + "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "^7.21.11" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -643,9 +653,17 @@ } }, "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.21.0-placeholder-for-preset-env.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", - "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "version": "7.21.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz", + "integrity": "sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.21.0", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, "engines": { "node": ">=6.9.0" }, @@ -1888,6 +1906,17 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/preset-env/node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/preset-env/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -3234,6 +3263,14 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.5.tgz", + "integrity": "sha512-XLNOMH66KhJzUJNwT/qlMnS4WsNDWD5ASdyaSH3EtK+F4r/CFGa3jT4GNi4mfOitGvWXtdLgQJkQjxSVrio+jA==", + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { "version": "5.1.1-v1", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", @@ -4547,6 +4584,19 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==" + }, + "node_modules/@types/whatwg-url": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.4.tgz", + "integrity": "sha512-lXCmTWSHJvf0TRSO58nm978b8HJ/EdsSsEKLd3ODHFjo+3VGAyyTp4v50nWvwtzBxSMQrVOK7tcuN0zGPLICMw==", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, "node_modules/@types/ws": { "version": "8.5.10", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", @@ -5435,6 +5485,29 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -5733,6 +5806,11 @@ "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==" }, + "node_modules/bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" + }, "node_modules/bfj": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/bfj/-/bfj-7.1.0.tgz", @@ -5902,6 +5980,19 @@ "node-int64": "^0.4.0" } }, + "node_modules/bson": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.5.0.tgz", + "integrity": "sha512-DXf1BTAS8vKyR90BO4x5v3rKVarmkdkzwOrnYDFdjAY694ILNDkmA3uRh1xXJEl+C1DAh8XCvAQ+Gh3kzubtpg==", + "engines": { + "node": ">=16.20.1" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -6272,6 +6363,148 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/concurrently": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.2.2.tgz", + "integrity": "sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg==", + "dependencies": { + "chalk": "^4.1.2", + "date-fns": "^2.30.0", + "lodash": "^4.17.21", + "rxjs": "^7.8.1", + "shell-quote": "^1.8.1", + "spawn-command": "0.0.2", + "supports-color": "^8.1.1", + "tree-kill": "^1.2.2", + "yargs": "^17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": "^14.13.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/concurrently/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/concurrently/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, "node_modules/confusing-browser-globals": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", @@ -6359,6 +6592,18 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -6817,6 +7062,21 @@ "node": ">=10" } }, + "node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -7158,11 +7418,14 @@ } }, "node_modules/dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, "node_modules/dotenv-expand": { @@ -7180,6 +7443,14 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -8488,9 +8759,9 @@ "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==" }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -12204,6 +12475,27 @@ "node": ">=0.10.0" } }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -12218,6 +12510,33 @@ "node": ">=4.0" } }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/kareem": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", + "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -12353,6 +12672,36 @@ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -12363,6 +12712,11 @@ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "node_modules/lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -12470,6 +12824,11 @@ "node": ">= 4.0.0" } }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" + }, "node_modules/merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -12665,6 +13024,136 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mongodb": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.3.0.tgz", + "integrity": "sha512-tt0KuGjGtLUhLoU263+xvQmPHEGTw5LbcNC73EoFRYgSHwZt5tsoJC110hDyO1kjQzpgNrpdcSza9PknWN4LrA==", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.0", + "bson": "^6.2.0", + "mongodb-connection-string-url": "^3.0.0" + }, + "engines": { + "node": ">=16.20.1" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.1.0", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.2", + "socks": "^2.7.1" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + }, + "socks": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.0.tgz", + "integrity": "sha512-t1Vf+m1I5hC2M5RJx/7AtxgABy1cZmIPQRMXw+gEIPn/cZNF3Oiy+l0UIypUwVB5trcWHq3crg2g3uAR9aAwsQ==", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "node_modules/mongodb-connection-string-url/node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/mongodb-connection-string-url/node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/mongodb-connection-string-url/node_modules/whatwg-url": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/mongoose": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.2.3.tgz", + "integrity": "sha512-ZB8K8AgbVgLCcqjtmZMxaQBEztwEEZCtAIPMx2Q56Uo4WWKmwf5Nu/EEIFo8d/17P946X0z6xzxwIqCxUMKxrA==", + "dependencies": { + "bson": "^6.2.0", + "kareem": "2.5.1", + "mongodb": "6.3.0", + "mpath": "0.9.0", + "mquery": "5.0.0", + "ms": "2.1.3", + "sift": "16.0.1" + }, + "engines": { + "node": ">=16.20.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mongoose/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mquery": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", + "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", + "dependencies": { + "debug": "4.x" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -14685,6 +15174,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -15053,6 +15547,14 @@ } } }, + "node_modules/react-scripts/node_modules/dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "engines": { + "node": ">=10" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -15481,6 +15983,14 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dependencies": { + "tslib": "^2.1.0" + } + }, "node_modules/safe-array-concat": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", @@ -15879,6 +16389,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/sift": { + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz", + "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==" + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -15971,6 +16486,19 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "deprecated": "Please use @jridgewell/sourcemap-codec instead" }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/spawn-command": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", + "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==" + }, "node_modules/spdy": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", @@ -16858,6 +17386,14 @@ "node": ">=8" } }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "bin": { + "tree-kill": "cli.js" + } + }, "node_modules/tryer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz", diff --git a/catalyst/package.json b/catalyst/package.json index 1baad3c..3448f0b 100644 --- a/catalyst/package.json +++ b/catalyst/package.json @@ -6,6 +6,13 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.6.8", + "bcryptjs": "^2.4.3", + "concurrently": "^8.2.2", + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "jsonwebtoken": "^9.0.2", + "mongoose": "^8.2.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", @@ -34,5 +41,8 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "^7.21.11" } } diff --git a/catalyst/src/.env b/catalyst/src/.env index 5de38bb..5a43a6e 100644 --- a/catalyst/src/.env +++ b/catalyst/src/.env @@ -1 +1,3 @@ -DB_URI="mongodb+srv://generic:BfHqDu7M7gEyN69r@catalyst.nnmbroy.mongodb.net/ \ No newline at end of file +REACT_APP_API_KEY='AIzaSyAwKzzuSj6uBTq1DOGzLULScbZSmMnLSZM' +DB_URI="mongodb+srv://generic:BfHqDu7M7gEyN69r@catalyst.nnmbroy.mongodb.net/" +JWT_SECRET="P0mV5ORpyJ7SPMD2KicMf845nOS6heysor339JpuO0vm4ixFrUmblGKUYfm6cs41uJuJa8O39uo16x4WY1h0CT9FlIlT0ND4eEB1u6CpIKlReCySSuihDRJuoy1zC4J1ttMn6o5e4F9AIcf4xG2fhhm4Pv39yffU7p19eWeu955BhYq8q42bhG493Zr1hN4p2i99iutCkN2e8319iWx8HU2K87a6pQKL14es5XWeL32rbciK2c04WBoVnBBGI2qlWM7p5YVPQAaIXKN0ls8lit7TI8FF5KdCDalXbU9W4rN7" From b888565d6d0e7ff2e15a052aefa54e010280793d Mon Sep 17 00:00:00 2001 From: Mariah McFarlane Date: Sun, 12 May 2024 16:48:29 -0700 Subject: [PATCH 3/7] Created tests for the functions in gemini.js --- catalyst/src/.env | 1 + catalyst/src/gemini.test.js | 106 ++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 catalyst/src/gemini.test.js diff --git a/catalyst/src/.env b/catalyst/src/.env index 5a43a6e..f56b7d6 100644 --- a/catalyst/src/.env +++ b/catalyst/src/.env @@ -1,3 +1,4 @@ REACT_APP_API_KEY='AIzaSyAwKzzuSj6uBTq1DOGzLULScbZSmMnLSZM' DB_URI="mongodb+srv://generic:BfHqDu7M7gEyN69r@catalyst.nnmbroy.mongodb.net/" JWT_SECRET="P0mV5ORpyJ7SPMD2KicMf845nOS6heysor339JpuO0vm4ixFrUmblGKUYfm6cs41uJuJa8O39uo16x4WY1h0CT9FlIlT0ND4eEB1u6CpIKlReCySSuihDRJuoy1zC4J1ttMn6o5e4F9AIcf4xG2fhhm4Pv39yffU7p19eWeu955BhYq8q42bhG493Zr1hN4p2i99iutCkN2e8319iWx8HU2K87a6pQKL14es5XWeL32rbciK2c04WBoVnBBGI2qlWM7p5YVPQAaIXKN0ls8lit7TI8FF5KdCDalXbU9W4rN7" +SKIP_PREFLIGHT_CHECK=true \ No newline at end of file diff --git a/catalyst/src/gemini.test.js b/catalyst/src/gemini.test.js new file mode 100644 index 0000000..f78f887 --- /dev/null +++ b/catalyst/src/gemini.test.js @@ -0,0 +1,106 @@ +import validate_questionnaire_format from './gemini'; +import validate_task_format from './gemini'; +import createPlan from './gemini'; + +//TESTS THE VALIDATE_QUESTIONAIRRE FORMAT FUNCTION +test('null input', () => { + boolean format = validate_questionnaire_format(null); + expect (format.toBe (false)); +}); + +test('empty input', () => { + boolean format = validate_questionnaire_format(""); + expect (format.toBe (false)); +}); + +test('array input', () => { + const sample_array = {1,2,3,4,5}; + boolean format = validate_questionnaire_format(sample_array); + expect(format.toBe(false)); +}); + +test('string over size two', () => { + const str = "Hello World"; + boolean format = validate_questionnaire_format(str); + expect(format.toBe(false)); +}); + +test('string size one', () => { + const str = "Z"; + boolean format = validate_questionnaire_format(str); + expect(format.toBe(false)); +}); + +test('string size two', () => { + const str = "Hi"; + boolean format = validate_questionnaire_format(str); + expect(format.toBe(true)); +}); + + +//TESTS THE VALIDATE_TASK_FORMAT FUNCTION +test('both empty', () => { + boolean format = validate_task_format("",""); + expect(format.toBe(false)); +}); + +test('both null', () => { + boolean format = validate_task_format(null,null); + expect(format.toBe(false)); +}); + +test('null and non-object', () => { + boolean format = validate_task_format(null,42); + expect(format.toBe(false)); +}); + +test('null and object', () => { + boolean format = validate_task_format(null,Object); + expect(format.toBe(false)); +}); + +test('non-object and null', () => { + boolean format = validate_task_format("Hi",null); + expect(format.toBe(false)); +}); + +test('both non-objects', () => { + boolean format = validate_task_format(21,42); + expect(format.toBe(false)); +}); + +test('non-object and object', () => { + boolean format = validate_task_format(3,Object); + expect(format.toBe(false)); +}); + +test('object and null', () => { + boolean format = validate_task_format(Object,null); + expect(format.toBe(false)); +}); + +test('Object and non-object', () => { + boolean format = validate_task_format(Object,42); + expect(format.toBe(false)); +}); + +//lengths are not same +test('both objects', () => { + boolean format = validate_task_format(Object,Object); + expect(format.toBe(false)); +}); + +//lengths are same key 2 doesn't include key +test('both objects', () => { + boolean format = validate_task_format(Object,Object); + expect(format.toBe(false)); +}); + +//lengths are same key 2 includes key +test('both objects', () => { + boolean format = validate_task_format(Object,Object); + expect(format.toBe(false)); +}); + + +//TESTS THE CREATE PLAN FUNCTION \ No newline at end of file From 5f7d0c188f3005ff4f5bb061b828705c5fc66ecc Mon Sep 17 00:00:00 2001 From: Mariah McFarlane <158103173+Mjmcfarlane@users.noreply.github.com> Date: Sun, 12 May 2024 20:56:56 -0700 Subject: [PATCH 4/7] Delete catalyst/src/.env --- catalyst/src/.env | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 catalyst/src/.env diff --git a/catalyst/src/.env b/catalyst/src/.env deleted file mode 100644 index f56b7d6..0000000 --- a/catalyst/src/.env +++ /dev/null @@ -1,4 +0,0 @@ -REACT_APP_API_KEY='AIzaSyAwKzzuSj6uBTq1DOGzLULScbZSmMnLSZM' -DB_URI="mongodb+srv://generic:BfHqDu7M7gEyN69r@catalyst.nnmbroy.mongodb.net/" -JWT_SECRET="P0mV5ORpyJ7SPMD2KicMf845nOS6heysor339JpuO0vm4ixFrUmblGKUYfm6cs41uJuJa8O39uo16x4WY1h0CT9FlIlT0ND4eEB1u6CpIKlReCySSuihDRJuoy1zC4J1ttMn6o5e4F9AIcf4xG2fhhm4Pv39yffU7p19eWeu955BhYq8q42bhG493Zr1hN4p2i99iutCkN2e8319iWx8HU2K87a6pQKL14es5XWeL32rbciK2c04WBoVnBBGI2qlWM7p5YVPQAaIXKN0ls8lit7TI8FF5KdCDalXbU9W4rN7" -SKIP_PREFLIGHT_CHECK=true \ No newline at end of file From 043f8c9b458de2c1197aea94001bca1eb3c06a35 Mon Sep 17 00:00:00 2001 From: Mariah McFarlane <158103173+Mjmcfarlane@users.noreply.github.com> Date: Sun, 12 May 2024 21:00:36 -0700 Subject: [PATCH 5/7] Update gemini.test.js --- catalyst/src/gemini.test.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/catalyst/src/gemini.test.js b/catalyst/src/gemini.test.js index f78f887..a9e0950 100644 --- a/catalyst/src/gemini.test.js +++ b/catalyst/src/gemini.test.js @@ -101,6 +101,3 @@ test('both objects', () => { boolean format = validate_task_format(Object,Object); expect(format.toBe(false)); }); - - -//TESTS THE CREATE PLAN FUNCTION \ No newline at end of file From 8d54658c40d291b280e2652d295065604531c74d Mon Sep 17 00:00:00 2001 From: Mariah McFarlane <158103173+Mjmcfarlane@users.noreply.github.com> Date: Sun, 12 May 2024 21:53:40 -0700 Subject: [PATCH 6/7] Fixed questionnaire format tests --- catalyst/src/gemini.test.js | 45 +++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/catalyst/src/gemini.test.js b/catalyst/src/gemini.test.js index a9e0950..6137389 100644 --- a/catalyst/src/gemini.test.js +++ b/catalyst/src/gemini.test.js @@ -1,38 +1,59 @@ import validate_questionnaire_format from './gemini'; import validate_task_format from './gemini'; import createPlan from './gemini'; +import Questionnaire from './Questionnaire'; //TESTS THE VALIDATE_QUESTIONAIRRE FORMAT FUNCTION test('null input', () => { - boolean format = validate_questionnaire_format(null); + const questionnaire = null; + boolean format = validate_questionnaire_format(questionnaire); expect (format.toBe (false)); }); test('empty input', () => { - boolean format = validate_questionnaire_format(""); + const questionnaire = ""; + boolean format = validate_questionnaire_format(questionnaire); expect (format.toBe (false)); }); -test('array input', () => { - const sample_array = {1,2,3,4,5}; - boolean format = validate_questionnaire_format(sample_array); +test('array size 5 input', () => { + const questionnaire = { 0:['1','2','3','4','5']}; + boolean format = validate_questionnaire_format(questionnaire); expect(format.toBe(false)); }); -test('string over size two', () => { - const str = "Hello World"; - boolean format = validate_questionnaire_format(str); +test('string input', () => { + const questionnaire = "Hello World"; + boolean format = validate_questionnaire_format(questionnaire); expect(format.toBe(false)); }); -test('string size one', () => { - const str = "Z"; +test('array size one', () => { + const questionnaire = {0:['1']}; boolean format = validate_questionnaire_format(str); expect(format.toBe(false)); }); -test('string size two', () => { - const str = "Hi"; +test('array size two', () => { + const str = {0:['1','2']}; + boolean format = validate_questionnaire_format(str); + expect(format.toBe(true)); +}); + +test('array size one and two', () => { + const str = { + 0:['Q1','Q2'] + 1:['Q1'] + }; + boolean format = validate_questionnaire_format(str); + expect(format.toBe(true)); +}); + +test('array size two and two', () => { + const str = { + 0:['Q1','Q2'] + 1:['Q1','Q2'] + }; boolean format = validate_questionnaire_format(str); expect(format.toBe(true)); }); From 5565791dadeac7484f2727e0da19d1355395410c Mon Sep 17 00:00:00 2001 From: Mariah McFarlane <158103173+Mjmcfarlane@users.noreply.github.com> Date: Mon, 13 May 2024 10:15:25 -0700 Subject: [PATCH 7/7] fixed the Booleans into variables and removed the test that used string --- catalyst/src/gemini.test.js | 64 +++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/catalyst/src/gemini.test.js b/catalyst/src/gemini.test.js index 6137389..e24eae3 100644 --- a/catalyst/src/gemini.test.js +++ b/catalyst/src/gemini.test.js @@ -6,38 +6,32 @@ import Questionnaire from './Questionnaire'; //TESTS THE VALIDATE_QUESTIONAIRRE FORMAT FUNCTION test('null input', () => { const questionnaire = null; - boolean format = validate_questionnaire_format(questionnaire); - expect (format.toBe (false)); + var rightFormat = validate_questionnaire_format(questionnaire); + expect (rightFormat.toBe (false)); }); test('empty input', () => { const questionnaire = ""; - boolean format = validate_questionnaire_format(questionnaire); - expect (format.toBe (false)); + var format = validate_questionnaire_format(questionnaire); + expect (rightFormat.toBe (false)); }); test('array size 5 input', () => { const questionnaire = { 0:['1','2','3','4','5']}; - boolean format = validate_questionnaire_format(questionnaire); - expect(format.toBe(false)); -}); - -test('string input', () => { - const questionnaire = "Hello World"; - boolean format = validate_questionnaire_format(questionnaire); - expect(format.toBe(false)); + var rightFormat = validate_questionnaire_format(questionnaire); + expect(rightFormat.toBe(false)); }); test('array size one', () => { const questionnaire = {0:['1']}; - boolean format = validate_questionnaire_format(str); - expect(format.toBe(false)); + var rightFormat = validate_questionnaire_format(str); + expect(rightFormat.toBe(false)); }); test('array size two', () => { const str = {0:['1','2']}; - boolean format = validate_questionnaire_format(str); - expect(format.toBe(true)); + var rightFormat = validate_questionnaire_format(str); + expect(rightFormat.toBe(true)); }); test('array size one and two', () => { @@ -45,8 +39,8 @@ test('array size one and two', () => { 0:['Q1','Q2'] 1:['Q1'] }; - boolean format = validate_questionnaire_format(str); - expect(format.toBe(true)); + var rightFormat = validate_questionnaire_format(str); + expect(rightFormat.toBe(true)); }); test('array size two and two', () => { @@ -54,71 +48,71 @@ test('array size two and two', () => { 0:['Q1','Q2'] 1:['Q1','Q2'] }; - boolean format = validate_questionnaire_format(str); - expect(format.toBe(true)); + var rightFormat = validate_questionnaire_format(str); + expect(rightFormat.toBe(true)); }); //TESTS THE VALIDATE_TASK_FORMAT FUNCTION test('both empty', () => { - boolean format = validate_task_format("",""); - expect(format.toBe(false)); + var rightFormat = validate_task_format("",""); + expect(rightFormat.toBe(false)); }); test('both null', () => { - boolean format = validate_task_format(null,null); - expect(format.toBe(false)); + var rightFormat = validate_task_format(null,null); + expect(rightFormat.toBe(false)); }); test('null and non-object', () => { - boolean format = validate_task_format(null,42); + var format = validate_task_format(null,42); expect(format.toBe(false)); }); test('null and object', () => { - boolean format = validate_task_format(null,Object); + var format = validate_task_format(null,Object); expect(format.toBe(false)); }); test('non-object and null', () => { - boolean format = validate_task_format("Hi",null); + var format = validate_task_format("Hi",null); expect(format.toBe(false)); }); test('both non-objects', () => { - boolean format = validate_task_format(21,42); + var format = validate_task_format(21,42); expect(format.toBe(false)); }); test('non-object and object', () => { - boolean format = validate_task_format(3,Object); + var format = validate_task_format(3,Object); expect(format.toBe(false)); }); test('object and null', () => { - boolean format = validate_task_format(Object,null); + var format = validate_task_format(Object,null); expect(format.toBe(false)); }); test('Object and non-object', () => { - boolean format = validate_task_format(Object,42); + var format = validate_task_format(Object,42); expect(format.toBe(false)); }); //lengths are not same test('both objects', () => { - boolean format = validate_task_format(Object,Object); + var format = validate_task_format([1,2,3],[4,5]); expect(format.toBe(false)); }); //lengths are same key 2 doesn't include key test('both objects', () => { - boolean format = validate_task_format(Object,Object); + var format = validate_task_format([1,2,3],[4,5,6]); expect(format.toBe(false)); }); //lengths are same key 2 includes key test('both objects', () => { - boolean format = validate_task_format(Object,Object); - expect(format.toBe(false)); + var format = validate_task_format([1,2,3],[1,2,3]); + expect(format.toBe(true)); });