diff options
Diffstat (limited to 'web-ui/test/unit')
-rw-r--r-- | web-ui/test/unit/common/input_field/input_field.spec.js | 20 | ||||
-rw-r--r-- | web-ui/test/unit/common/submit_button/submit_button.spec.js | 16 |
2 files changed, 36 insertions, 0 deletions
diff --git a/web-ui/test/unit/common/input_field/input_field.spec.js b/web-ui/test/unit/common/input_field/input_field.spec.js new file mode 100644 index 00000000..88983f4f --- /dev/null +++ b/web-ui/test/unit/common/input_field/input_field.spec.js @@ -0,0 +1,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') + }) +}) diff --git a/web-ui/test/unit/common/submit_button/submit_button.spec.js b/web-ui/test/unit/common/submit_button/submit_button.spec.js new file mode 100644 index 00000000..629b3545 --- /dev/null +++ b/web-ui/test/unit/common/submit_button/submit_button.spec.js @@ -0,0 +1,16 @@ +import { shallow } from 'enzyme' +import expect from 'expect' +import React from 'react' +import SubmitButton from 'src/common/submit_button/submit_button' + +describe('SubmitButton', () => { + let submitButton + + beforeEach(() => { + submitButton = shallow(<SubmitButton buttonText="Add Email" />) + }) + + it('renders an input of type submit for add email', () => { + expect(submitButton.find('input[type="submit"]').props().value).toEqual('Add Email') + }) +}) |