22198: Remove 'href' where it appears in processing API responses
[arvados.git] / services / workbench2 / src / views-components / context-menu / actions / file-viewer-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 { FileViewerAction } from './file-viewer-action';
7 import { ThemeProvider } from '@mui/material';
8 import { CustomTheme } from 'common/custom-theme';
9
10 describe('FileViewerAction', () => {
11     let props;
12
13     beforeEach(() => {
14         props = {
15             onClick: cy.stub().as('onClick'),
16             href: 'https://example.com',
17         };
18     });
19
20     it('should render properly and handle click', () => {
21         // when
22         cy.mount(
23             <ThemeProvider theme={CustomTheme}>
24                 <FileViewerAction {...props} />
25             </ThemeProvider>);
26         
27         // then
28         cy.get('[data-cy=open-in-new-tab]').should('exist');
29         cy.get('[data-cy=open-in-new-tab]').click();
30
31         // and
32         cy.get('@onClick').should('have.been.called');
33     });
34 });