emailField.spec.jsx 848 B

1234567891011121314151617181920212223242526272829303132
  1. import React from 'react';
  2. import {shallow} from 'enzyme';
  3. import {EmailField} from 'app/components/forms';
  4. describe('EmailField', function() {
  5. describe('render()', function() {
  6. it('renders', function() {
  7. let wrapper = shallow(<EmailField name="fieldName" />);
  8. expect(wrapper).toMatchSnapshot();
  9. });
  10. it('renders with value', function() {
  11. let wrapper = shallow(<EmailField name="fieldName" value="foo@example.com" />);
  12. expect(wrapper).toMatchSnapshot();
  13. });
  14. it('renders with form context', function() {
  15. let wrapper = shallow(<EmailField name="fieldName" />, {
  16. context: {
  17. form: {
  18. data: {
  19. fieldName: 'foo@example.com',
  20. },
  21. errors: {},
  22. },
  23. },
  24. });
  25. expect(wrapper).toMatchSnapshot();
  26. });
  27. });
  28. });