import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as TestUtils from 'react-addons-test-utils';
import Welcome from '../../../app/components/welcome';

describe('Welcome', () => {
  let renderer: TestUtils.ShallowRenderer;

  beforeEach(() => {
    renderer = TestUtils.createRenderer();
    renderer.render(<Welcome compiler='TypeScript' framework='React' />);
  });

  it('renders', () => {
    const result = renderer.getRenderOutput();
    chai.assert.strictEqual(result.type, 'div');
  });

  it('should have correct prop values', () => {
    const result = renderer.getRenderOutput();

    // Drill down to the header title text properties.
    const header = result.props.children[0];
    const title = header.props.children;
    const text = title.props.children.join('');

    chai.assert.strictEqual(text, 'Hello from TypeScript and React!');
  });
});
