File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
packages/react-core/src/components/Card/__tests__ Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ import { render , screen } from '@testing-library/react' ;
2+ import { CardDescription } from '../CardDescription' ;
3+
4+ describe ( 'CardDescription' , ( ) => {
5+ test ( 'renders with PatternFly Core styles' , ( ) => {
6+ const { asFragment } = render ( < CardDescription > text</ CardDescription > ) ;
7+ expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
8+ } ) ;
9+
10+ test ( 'className is added to the root element' , ( ) => {
11+ render ( < CardDescription className = "extra-class" > text</ CardDescription > ) ;
12+ expect ( screen . getByText ( 'text' ) ) . toHaveClass ( 'extra-class' ) ;
13+ } ) ;
14+
15+ test ( 'extra props are spread to the root element' , ( ) => {
16+ const testId = 'card-description' ;
17+
18+ render ( < CardDescription data-testid = { testId } /> ) ;
19+ expect ( screen . getByTestId ( testId ) ) . toBeInTheDocument ( ) ;
20+ } ) ;
21+ } ) ;
You can’t perform that action at this time.
0 commit comments