/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; import { render, fireEvent } from '@testing-library/react'; import ContentPanelActions from '../ContentPanel/ContentPanelActions'; describe(' spec', () => { it('renders the component', () => { const actions = [{ component: 'ContentPanelActions' }]; const { container } = render(); expect(container.firstChild).toMatchSnapshot(); }); it('renders a button to click', () => { const spy = jest.fn(); const actions = [ { component: ( ), }, ]; const { getByTestId } = render(); fireEvent.click(getByTestId('ContentPanelActionsButton')); expect(spy).toHaveBeenCalledTimes(1); }); });