ButtonRow.test.tsx 673 B

1234567891011121314151617181920212223242526272829303132
  1. import React from 'react';
  2. import { shallow } from 'enzyme';
  3. import ButtonRow, { Props } from './ButtonRow';
  4. const setup = (propOverrides?: object) => {
  5. const props: Props = {
  6. isReadOnly: true,
  7. onSubmit: jest.fn(),
  8. onDelete: jest.fn(),
  9. onTest: jest.fn(),
  10. };
  11. Object.assign(props, propOverrides);
  12. return shallow(<ButtonRow {...props} />);
  13. };
  14. describe('Render', () => {
  15. it('should render component', () => {
  16. const wrapper = setup();
  17. expect(wrapper).toMatchSnapshot();
  18. });
  19. it('should render with buttons enabled', () => {
  20. const wrapper = setup({
  21. isReadOnly: false,
  22. });
  23. expect(wrapper).toMatchSnapshot();
  24. });
  25. });