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, within } from '@testing-library/react';
import '@testing-library/jest-dom';
import CodeModal from './CodeModal';
describe('ChatbotModal', () => {
    it('should render compact modal', () => {
        render(_jsx(CodeModal, { isCompact: true, code: "Hello world", fileName: "greetings.txt", isModalOpen: true, handleModalToggle: jest.fn(), onPrimaryAction: jest.fn(), onSecondaryAction: jest.fn(), title: "Preview attachment", primaryActionBtn: "Submit", secondaryActionBtn: "Cancel" }));
        expect(screen.getByRole('dialog')).toHaveClass('pf-m-compact');
    });
    it('should render CodeModal with custom classNames', () => __awaiter(void 0, void 0, void 0, function* () {
        render(_jsx(CodeModal, { isCompact: true, code: "Hello world", fileName: "greetings.txt", isModalOpen: true, handleModalToggle: jest.fn(), onPrimaryAction: jest.fn(), onSecondaryAction: jest.fn(), title: "Preview attachment", primaryActionBtn: "Submit", secondaryActionBtn: "Cancel", modalHeaderClassName: "custom-header-class", modalBodyClassName: "custom-body-class", modalFooterClassName: "custom-footer-class" }));
        const modal = screen.getByRole('dialog');
        const modalHeader = within(modal).getByRole('banner');
        expect(modalHeader).toHaveClass('custom-header-class');
        const modalBody = modal.querySelector('#code-modal-body');
        expect(modalBody).toHaveClass('custom-body-class');
        const modalfooter = within(modal).getByRole('contentinfo');
        expect(modalfooter).toHaveClass('custom-footer-class');
    }));
});
