import Heading from './Heading.component';

describe('<Heading>', () => {
  it('SAD: without props', () => {
    expect(() => shallow(<Heading />)).toThrow();
  });

  it('Happy: Render Heading H1 variation', () => {
    const wrapper = shallow(<Heading as="h1" />);
    expect(wrapper).toHaveLength(1);

    const json = renderJSON(<Heading as="h1" />);
    expect(json.type).toBe('h1');
  });

  it('Happy: Render Heading H3 variation', () => {
    const json = renderJSON(<Heading as="h3" />);
    expect(json.type).toBe('h3');
  });

  it('Happy: Render Heading textOverflow variation', () => {
    const json = renderJSON(<Heading as="h3" textOverflow />);
    expect(json.type).toBe('h3');
  });

  it('renders with as prop', () => {
    const json = renderJSON(<Heading as="p" />);
    expect(json.type).toBe('p');
  });
});
