import { render, screen } from '@testing-library/react';
import { DrawerColorVariant } from '../Drawer';
import { DrawerSection } from '../DrawerSection';
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
test(`Renders with only class ${styles.drawerSection} by default`, () => {
render(Section content);
expect(screen.getByText('Section content')).toHaveClass(styles.drawerSection, { exact: true });
});
test(`Applies ${styles.drawerSection} and ${styles.modifiers.plain} when isPlain is true`, () => {
render(Section content);
const section = screen.getByText('Section content');
expect(section).toHaveClass(styles.drawerSection);
expect(section).toHaveClass(styles.modifiers.plain);
});
test(`Does not apply ${styles.modifiers.plain} when isPlain is false`, () => {
render(Section content);
expect(screen.getByText('Section content')).not.toHaveClass(styles.modifiers.plain);
});
test(`Applies plain and secondary modifiers together when isPlain and colorVariant are set`, () => {
render(
Section content
);
const section = screen.getByText('Section content');
expect(section).toHaveClass(styles.drawerSection);
expect(section).toHaveClass(styles.modifiers.plain);
expect(section).toHaveClass(styles.modifiers.secondary);
});