File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
2+ import { render } from "@testing-library/react" ;
3+ import faker from "faker" ;
4+ import { Paragraph } from "./paragraph" ;
25
36describe ( "Paragraph" , ( ) => {
4- test . skip ( "TODO - https://github.com/AndcultureCode/AndcultureCode.JavaScript.React.Components/issues/15" , ( ) => { } ) ;
7+ test ( "when default props, renders paragraph with text" , ( ) => {
8+ // Act
9+ const expected = faker . random . words ( ) ;
10+
11+ // Arrange
12+ const { getByText } = render ( < Paragraph > { expected } </ Paragraph > ) ;
13+
14+ // Assert
15+ expect ( getByText ( expected ) ) . not . toBeNil ( ) ;
16+ } ) ;
17+
18+ test ( "when given cssClassName prop, renders paragraph with given class name" , ( ) => {
19+ // Act
20+ const expected = faker . random . words ( ) ;
21+ const testClassName = "testClassName" ;
22+
23+ // Arrange
24+ const { container } = render (
25+ < Paragraph cssClassName = { testClassName } > { expected } </ Paragraph >
26+ ) ;
27+ const result = container . querySelector ( "." + testClassName ) ;
28+
29+ // Assert
30+ expect ( result ) . not . toBeNil ( ) ;
31+ } ) ;
532} ) ;
You can’t perform that action at this time.
0 commit comments