1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { shallow, configure } from 'enzyme';
7 import { ListItem } from "@mui/material";
8 import Adapter from 'enzyme-adapter-react-16';
9 import { CopyToClipboardAction } from './copy-to-clipboard-action';
11 configure({ adapter: new Adapter() });
13 jest.mock('copy-to-clipboard', () => jest.fn());
15 describe('CopyToClipboardAction', () => {
21 href: 'https://collections.example.com/c=zzzzz-4zz18-k0hamvtwyit6q56/t=xxxxxxxx/LIMS/1.html',
25 it('should render properly and handle click', () => {
27 const wrapper = shallow(<CopyToClipboardAction {...props} />);
28 wrapper.find(ListItem).simulate('click');
31 expect(wrapper).not.toBeUndefined();
34 expect(props.onClick).toHaveBeenCalled();