"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("@testing-library/react");
require("@testing-library/jest-dom");
const DeepThinking_1 = __importDefault(require("./DeepThinking"));
describe('DeepThinking', () => {
    const defaultProps = {
        toggleContent: 'Show thinking'
    };
    it('should render with required props only', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps)));
        expect(react_1.screen.getByText('Show thinking')).toBeTruthy();
    });
    it('should render subheading when provided', () => {
        const subheading = 'Thought for 3 seconds';
        (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { subheading: subheading })));
        expect(react_1.screen.getByText(subheading)).toBeTruthy();
    });
    it('should render body content when provided', () => {
        const body = "Here's why I think that";
        (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { body: body })));
        expect(react_1.screen.getByText(body)).toBeTruthy();
    });
    it('should render with complex content including React elements', () => {
        const body = ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { children: "Complex body content" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: "Item 1" }), (0, jsx_runtime_1.jsx)("li", { children: "Item 2" })] })] }));
        (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { body: body })));
        expect(react_1.screen.getByText('Complex body content')).toBeTruthy();
        expect(react_1.screen.getByText('Item 1')).toBeTruthy();
        expect(react_1.screen.getByText('Item 2')).toBeTruthy();
    });
    it('should apply custom className from cardProps', () => {
        const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { cardProps: { className: 'custom-tool-response-class' } })));
        expect(container.querySelector('.custom-tool-response-class')).toBeTruthy();
    });
    it('should pass through expandableSectionProps', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { expandableSectionProps: { className: 'custom-expandable-class' } })));
        expect(document.querySelector('.custom-expandable-class')).toBeTruthy();
    });
    it('should not render subheading span when subheading is not provided', () => {
        const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps)));
        const subheadingContainer = container.querySelector('.pf-chatbot__tool-response-subheading');
        expect(subheadingContainer).toBeFalsy();
    });
});
