import React from 'react';
import { ShallowWrapper, configure, shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Title from './Title';
import { Props } from './Title.types';

configure({ adapter: new Adapter() })

const props: Props = {
  children: <span>Test</span>
};

describe('Card Title component', () => {
  const title: ShallowWrapper<Props> = shallow(<Title {...props} />);

  it('should match the snapshot', () => {
    expect(title).toMatchSnapshot();
  });

  it('should have the default classNames', () => {
    expect(title.hasClass('app-card-title')).toBe(true);
  });

  it('should render the children properly', () => {
    expect(title.props().children).toEqual(props.children);
  });
});
