FormGroup.test.tsx 527 B

1234567891011121314151617181920212223242526
  1. import React from 'react';
  2. import { shallow } from 'enzyme';
  3. import { FormGroup, Props } from './FormGroup';
  4. const setup = (propOverrides?: object) => {
  5. const props: Props = {
  6. label: 'Test',
  7. labelWidth: 11,
  8. inputProps: {
  9. value: 10,
  10. onChange: jest.fn(),
  11. },
  12. };
  13. Object.assign(props, propOverrides);
  14. return shallow(<FormGroup {...props} />);
  15. };
  16. describe('Render', () => {
  17. it('should render component', () => {
  18. const wrapper = setup();
  19. expect(wrapper).toMatchSnapshot();
  20. });
  21. });