var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
import { jsx as _jsx } from "react/jsx-runtime";
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import ChatbotWelcomePrompt from './ChatbotWelcomePrompt';
import userEvent from '@testing-library/user-event';
describe('ChatbotWelcomePrompt', () => {
    it('should render welcome prompt', () => {
        const { container } = render(_jsx(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?" }));
        expect(container).toMatchSnapshot();
    });
    it('should render correctly', () => {
        render(_jsx(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?" }));
        expect(screen.getByText('Hi, ChatBot User!')).toBeTruthy();
        expect(screen.getByText('How can I help you today?')).toBeTruthy();
    });
    it('should render prompts with titles correctly', () => {
        render(_jsx(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?", prompts: [{ title: 'Set up account' }] }));
        expect(screen.getByText('Set up account')).toBeTruthy();
    });
    it('should render prompts with messages correctly', () => {
        render(_jsx(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?", prompts: [
                { title: 'Set up account', message: 'Choose the necessary settings and preferences for your account.' }
            ] }));
        expect(screen.getByText('Choose the necessary settings and preferences for your account.')).toBeTruthy();
    });
    it('should render prompts with onClick correctly', () => __awaiter(void 0, void 0, void 0, function* () {
        const spy = jest.fn();
        render(_jsx(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?", prompts: [
                {
                    title: 'Set up account',
                    message: 'Choose the necessary settings and preferences for your account.',
                    onClick: spy
                }
            ] }));
        yield userEvent.click(screen.getByRole('button', { name: /Set up account/i }));
        expect(spy).toHaveBeenCalled();
    }));
    it('should apply className appropriately', () => {
        render(_jsx(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?", className: "test", testId: "welcome-prompt" }));
        const element = screen.getByTestId('welcome-prompt');
        expect(element).toHaveClass('test');
    });
    it('should handle isCompact', () => {
        render(_jsx(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?", className: "test", testId: "welcome-prompt", isCompact: true }));
        expect(screen.getByTestId('welcome-prompt')).toHaveClass('pf-m-compact');
    });
});
