import { shallow } from 'enzyme';
import React from 'react';

import { Newline } from './Newline';

describe('Newline format', () => {
  let wrapper;

  beforeEach(() => {
    wrapper = shallow(<Newline />);
  });

  it('renders', () => {
    expect(wrapper).toExist();
  });

  it('renders a line break', () => {
    expect(wrapper.find('br')).toExist();
  });

  it('does not render any further children', () => {
    const RichText = () => null;
    wrapper.setProps({ RichText });
    expect(wrapper.find(RichText)).not.toExist();
  });
});
