17782: Fixes a jest warning when running tests.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 6 Jul 2021 20:17:05 +0000 (17:17 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 6 Jul 2021 20:17:05 +0000 (17:17 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

package.json
src/views-components/token-dialog/token-dialog.test.tsx
yarn.lock

index 67c210ae97c56d8261e5aefc605f83351460d459..857620762d74d6e78dbad56b05e3ebafcb8a69ee 100644 (file)
@@ -15,7 +15,7 @@
     "@types/jszip": "3.1.5",
     "@types/lodash": "4.14.116",
     "@types/react": "17.0.11",
-    "@types/react-copy-to-clipboard": "4.2.6",
+    "@types/react-copy-to-clipboard": "5.0.0",
     "@types/react-dropzone": "4.2.2",
     "@types/react-highlight-words": "0.12.0",
     "@types/react-virtualized-auto-sizer": "1.0.0",
@@ -45,7 +45,7 @@
     "prop-types": "15.7.2",
     "query-string": "6.9.0",
     "react": "16.8.6",
-    "react-copy-to-clipboard": "5.0.1",
+    "react-copy-to-clipboard": "5.0.3",
     "react-dnd": "5.0.0",
     "react-dnd-html5-backend": "5.0.1",
     "react-dom": "16.8.6",
index 4d1412d8430ff732b0e9b5d6459c846065923b53..d2ff77e3d41777b1dad76806c6150b29037e8d64 100644 (file)
@@ -2,6 +2,14 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
+// This mocks react-copy-to-clipboard's dependency module to avoid warnings
+// from jest when running tests. As we're not testing copy-to-clipboard, it's
+// safe to just mock it.
+// https://github.com/nkbt/react-copy-to-clipboard/issues/106#issuecomment-605227151
+jest.mock('copy-to-clipboard', () => {
+  return jest.fn();
+});
+
 import React from 'react';
 import { Button } from '@material-ui/core';
 import { mount, configure } from 'enzyme';
index 9159597d857700494a3b6a0fee6fd42cac51927e..30b722bbef262008d33d9efafa2322ca1d782b4d 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
   resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24"
   integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==
 
-"@types/react-copy-to-clipboard@4.2.6":
-  version "4.2.6"
-  resolved "https://registry.yarnpkg.com/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-4.2.6.tgz#d1374550dec803f17f26ec71b62783c5737bfc02"
-  integrity sha512-v4/yLsuPf8GSFuTy9fA1ABpL5uuy04vwW7qs+cfxSe1UU/M/KK95rF3N3GRseismoK9tA28SvpwVsAg/GWoF3A==
+"@types/react-copy-to-clipboard@5.0.0":
+  version "5.0.0"
+  resolved "https://registry.yarnpkg.com/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.0.tgz#38b035ca0c28334d3e0efaf3f319b81eea9690cd"
+  integrity sha512-faUg6Kx3Dfv0MBIcs+xzIptlRtjEVSaNjqyC14YAp4UwSiTHghnKtBOt9ERRTZZJfoJgnw10tomVaqG86GzdAw==
   dependencies:
     "@types/react" "*"
 
@@ -10911,10 +10911,10 @@ react-app-polyfill@^1.0.6:
     regenerator-runtime "^0.13.3"
     whatwg-fetch "^3.0.0"
 
-react-copy-to-clipboard@5.0.1:
-  version "5.0.1"
-  resolved "https://registry.yarnpkg.com/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.1.tgz#8eae107bb400be73132ed3b6a7b4fb156090208e"
-  integrity sha512-ELKq31/E3zjFs5rDWNCfFL4NvNFQvGRoJdAKReD/rUPA+xxiLPQmZBZBvy2vgH7V0GE9isIQpT9WXbwIVErYdA==
+react-copy-to-clipboard@5.0.3:
+  version "5.0.3"
+  resolved "https://registry.yarnpkg.com/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.3.tgz#2a0623b1115a1d8c84144e9434d3342b5af41ab4"
+  integrity sha512-9S3j+m+UxDZOM0Qb8mhnT/rMR0NGSrj9A/073yz2DSxPMYhmYFBMYIdI2X4o8AjOjyFsSNxDRnCX6s/gRxpriw==
   dependencies:
     copy-to-clipboard "^3"
     prop-types "^15.5.8"