File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
packages/pf4-component-mapper/src/tests Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { mount } from 'enzyme' ;
3
+ import { TextContent , Text } from '@patternfly/react-core' ;
4
+
5
+ import PlainText from '../form-fields/plain-text' ;
6
+
7
+ describe ( 'PlainText component' , ( ) => {
8
+ it ( 'renders correctly with three paragraphs' , ( ) => {
9
+ const label = 'One \n Two \n Three' ;
10
+ const name = 'name' ;
11
+
12
+ const wrapper = mount ( < PlainText name = { name } label = { label } /> ) ;
13
+
14
+ expect ( wrapper . find ( TextContent ) ) . toHaveLength ( 1 ) ;
15
+ expect ( wrapper . find ( Text ) ) . toHaveLength ( 3 ) ;
16
+ } ) ;
17
+
18
+ it ( 'renders correctly with one paragraphs' , ( ) => {
19
+ const label = 'One' ;
20
+ const name = 'name' ;
21
+
22
+ const wrapper = mount ( < PlainText name = { name } label = { label } /> ) ;
23
+
24
+ expect ( wrapper . find ( TextContent ) ) . toHaveLength ( 1 ) ;
25
+ expect ( wrapper . find ( Text ) ) . toHaveLength ( 1 ) ;
26
+ } ) ;
27
+ } ) ;
You can’t perform that action at this time.
0 commit comments