import { render, screen } from '@testing-library/react'; import { DrawerPanelDescription } from '../DrawerPanelDescription'; import styles from '@patternfly/react-styles/css/components/Drawer/drawer'; import '@testing-library/jest-dom'; test(`Renders with only class ${styles.drawerDescription} by default`, () => { render(description content); expect(screen.getByText('description content')).toHaveClass(styles.drawerDescription, { exact: true }); }); test(`Renders with custom class when className is passed`, () => { render(description content); expect(screen.getByText('description content')).toHaveClass('test-class'); }); test(`Spreads props`, () => { render(description content); expect(screen.getByText('description content')).toHaveAttribute('id', 'test-id'); }); test(`Matches snapshot`, () => { const { asFragment } = render(description content); expect(asFragment()).toMatchSnapshot(); });