import React from 'react';
import { createShallow } from '@material-ui/core/test-utils';

import SectionMemo, { Section } from './Section';

describe('<Section />', () => {
  const shallow = createShallow();

  it('shallow render without crashing', () => {
    const wrapper = shallow(
      <Section title='Title' description='Description' />
    );
    expect(wrapper).toMatchSnapshot();
  });

  it('shallow render with children without crashing', () => {
    const wrapper = shallow(
      <Section title='Title' description='Description'>
        <div>Test</div>
      </Section>
    );
    expect(wrapper).toMatchSnapshot();
  });

  it('shallow render memoized component without crashing', () => {
    const wrapper = shallow(
      <SectionMemo title='Title' description='Description' />
    );
    expect(wrapper).toMatchSnapshot();
  });

  it('shallow render with children memoized component without crashing', () => {
    const wrapper = shallow(
      <SectionMemo title='Title' description='Description'>
        <div>Test</div>
      </SectionMemo>
    );
    expect(wrapper).toMatchSnapshot();
  });
});
