"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("@testing-library/react");
const ChatbotHeaderNewChatButton_1 = require("./ChatbotHeaderNewChatButton");
require("@testing-library/jest-dom");
describe('ChatbotHeaderNewChatButton', () => {
    it('should render ChatbotHeaderNewChatButton', () => {
        const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderNewChatButton_1.ChatbotHeaderNewChatButton, { className: "custom-header-new-chat-button", onClick: jest.fn() }));
        expect(container.querySelector('.custom-header-new-chat-button')).toBeTruthy();
    });
    it('should call onClick handler when new chat button is pressed', () => {
        const onClick = jest.fn();
        (0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderNewChatButton_1.ChatbotHeaderNewChatButton, { className: "custom-header-new-chat-button", onClick: onClick }));
        react_1.fireEvent.click(react_1.screen.getByRole('button', { name: 'New chat' }));
        expect(onClick).toHaveBeenCalled();
    });
    it('should render button with isCompact', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderNewChatButton_1.ChatbotHeaderNewChatButton, { "data-testid": "new-chat-button", onClick: jest.fn(), isCompact: true }));
        expect(react_1.screen.getByTestId('new-chat-button')).toHaveClass('pf-m-compact');
    });
});
