import * as React from 'react';
import { render, screen } from '@testing-library/react';
import { SidebarContent } from '../SidebarContent';
test('Renders children', () => {
render(Test);
expect(screen.getByText('Test')).toBeVisible();
});
test('Renders with only class name pf-v5-c-sidebar__content by default', () => {
render(Test);
expect(screen.getByText('Test')).toHaveClass('pf-v5-c-sidebar__content', { exact: true });
});
test('Renders with class name pf-v5-c-sidebar__content', () => {
render(Test);
expect(screen.getByText('Test')).toHaveClass('pf-v5-c-sidebar__content');
});
test('Renders with custom class name when className prop is provided', () => {
render(Test);
expect(screen.getByText('Test')).toHaveClass('custom-class');
});
test('Renders with class name pf-m-no-background when hasNoBackground prop is passed', () => {
render(Test);
expect(screen.getByText('Test')).toHaveClass('pf-m-no-background');
});
test('Renders with class name pf-m-padding when hasPadding prop is passed', () => {
render(Test);
expect(screen.getByText('Test')).toHaveClass('pf-m-padding');
});
test('Renders with inherited element props spread to the component', () => {
render(Test);
expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
});
test('Matches the snapshot', () => {
const { asFragment } = render(Test);
expect(asFragment()).toMatchSnapshot();
});