passwordField.spec.jsx 851 B

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