Skip to content

Commit a686a0e

Browse files
committed
Add test for MUI plain text
1 parent b629a43 commit a686a0e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
import { mount } from 'enzyme';
3+
import Typography from '@material-ui/core/Typography';
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(Typography)).toHaveLength(3);
15+
});
16+
17+
it('renders correctly with one paragraphs', () => {
18+
const label = 'One';
19+
const name = 'name';
20+
21+
const wrapper = mount(<PlainText name={ name } label={ label }/>);
22+
23+
expect(wrapper.find(Typography)).toHaveLength(1);
24+
});
25+
});

0 commit comments

Comments
 (0)