content: import Component from '../horizontal-bar-content';
  import TestFunctions from './__test-functions__';
  import React from 'react';
  
  describe('HorizontalBarContent', () => {
    const { renderIntoDocument } = React.addons.TestUtils;
  
    TestFunctions.isOfExpectedType(Component, 'g', 'horizontal-bar-content');
  
    TestFunctions.hasExpectedDefaultProps(Component, {
      height: 0,
      icon: '',
      iconClipPathId: '',
      iconHeight: 0,
      index: -1,
      label: '',
      width: 0,
    });
  
    TestFunctions.hasExpectedInitialState(Component, {
      layout: {},
    });
  
    describe('has a componentWillReceiveProps method that', () => {
      const component = renderIntoDocument(<Component />);
      it('calls setStateFromProps', () => {
        spyOn(component, 'setStateFromProps');
        component.componentWillReceiveProps({});
        expect(component.setStateFromProps).toHaveBeenCalled();
      });
    });
  
    describe('has a getLabelX method that', () => {
      const component = renderIntoDocument(<Component />);
      it('returns an x position for the label', () => {
        expect(component.getLabelX('', {
          children: [{
            left: 10,
          }],
        })).toEqual(10);
      });
      it('returns 0 for invalid input', () => {
        expect(component.getLabelX()).toEqual(0);
        expect(component.getLabelX('')).toEqual(0);
        expect(component.getLabelX('', {})).toEqual(0);
        expect(component.getLabelX('', {
          children: [],
        })).toEqual(0);
        expect(component.getLabelX()).toEqual(0);
      });
    });
  });
  