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(
);
expect(screen.getByRole('dialog')).toHaveClass('pf-m-compact');
});
it('should render CodeModal with custom classNames', async () => {
render(
);
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');
});
});