textField.spec.jsx 682 B

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