booleanField.spec.jsx 690 B

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