Skip to content

Commit cdd8f16

Browse files
committed
Add tests for PF4 plain text
1 parent 8df00ca commit cdd8f16

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
});

0 commit comments

Comments
 (0)