17782: Fixes a jest warning when running tests.
[arvados-workbench2.git] / src / views-components / token-dialog / token-dialog.test.tsx
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';