blob: 0c044ce13be58f9ec58c1e763b2ea714bae68ac9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import { shallow } from 'enzyme';
import expect from 'expect';
import React from 'react';
import InputField from 'src/common/input_field/input_field';
describe('InputField', () => {
let inputField;
beforeEach(() => {
inputField = shallow(<InputField label='Email' name='email' />);
});
it('renders an input of type text for email', () => {
expect(inputField.find('input[type="text"]').props().name).toEqual('email');
});
it('renders a label for the email', () => {
expect(inputField.find('label').text()).toEqual('Email');
});
});
|