Skip to content

Commit

Permalink
test(pci-instances): update actionsCell unitary test
Browse files Browse the repository at this point in the history
ref: TAPC-2160
Signed-off-by: Frédéric Vilcot <[email protected]>
  • Loading branch information
fredericvilcot committed Nov 12, 2024
1 parent d855b99 commit a63e560
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import { render, screen } from '@testing-library/react';
import { describe, vi } from 'vitest';
import { ActionsCell } from './ActionsCell.component';
import { mockedInstance } from '@/__mocks__/instance/constants';
import { ActionsCell, TActionsCellProps } from './ActionsCell.component';

vi.mock('react-router-dom', () => ({
useHref: () => mockedInstance.id,
useHref: () => 'foo',
}));

const initialProps: TActionsCellProps = {
isLoading: false,
hrefs: {
deleteHref: 'foo/delete',
detailsHref: 'foo/details',
autobackupHref: 'foo/autobackup',
},
};

describe('Considering the ActionsCell component', () => {
test('Should render component correctly', () => {
render(<ActionsCell instance={mockedInstance} isLoading={false} />);
render(<ActionsCell {...initialProps} />);
const actionsMenuElement = screen.getByTestId('actions-menu-button');
expect(actionsMenuElement).toBeInTheDocument();
});
Expand Down

0 comments on commit a63e560

Please sign in to comment.