21362: Search for bundler in the arvados-api-server package test
[arvados.git] / services / workbench2 / src / views-components / context-menu / actions / copy-to-clipboard-action.cy.js
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import React from 'react';
6 import { CopyToClipboardAction } from './copy-to-clipboard-action';
7
8 describe('CopyToClipboardAction', () => {
9     let props;
10
11     beforeEach(() => {
12         props = {
13             onClick: cy.stub().as('onClick'),
14             href: 'https://collections.example.com/c=zzzzz-4zz18-k0hamvtwyit6q56/t=xxxxxxxx/LIMS/1.html',
15         };
16     });
17
18     it('should render properly and handle click', () => {
19         // when
20         cy.mount(<CopyToClipboardAction {...props} />);
21
22         // check
23         cy.contains('Copy link to clipboard').click();
24
25         // then
26         cy.get('@onClick').should('have.been.called');
27     });
28 });