import { fireEvent, render, screen } from '@testing-library/react';
import { ChatbotHeaderMenu } from './ChatbotHeaderMenu';
import '@testing-library/jest-dom';
describe('ChatbotHeaderMenu', () => {
it('should render ChatbotHeaderMenu with custom class', () => {
const { container } = render();
expect(container.querySelector('.custom-header-menu')).toBeTruthy();
});
it('should call onMenuToggle when ChatbotHeaderMenu button is clicked', () => {
const onMenuToggle = jest.fn();
render();
fireEvent.click(screen.getByRole('button', { name: 'Chat history menu' }));
expect(onMenuToggle).toHaveBeenCalled();
});
it('should handle isCompact', () => {
render(
);
expect(screen.getByTestId('button')).toHaveClass('pf-m-compact');
});
});