'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactTestRenderer = require('react-test-renderer');

var _reactTestRenderer2 = _interopRequireDefault(_reactTestRenderer);

var _index = require('./index');

var _index2 = _interopRequireDefault(_index);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Header = _index2.default.Header,
    Footer = _index2.default.Footer,
    Body = _index2.default.Body,
    Row = _index2.default.Row,
    RowColumn = _index2.default.RowColumn; // eslint-disable-line import/no-extraneous-dependencies

test('Table renders correctly', function () {
  var tree = _reactTestRenderer2.default.create(_react2.default.createElement(
    _index2.default,
    {
      style: { minHeight: '300px' },
      onChange: function onChange() {},
      displayRowCheckbox: true,
      multiSelectable: true,
      fixedFooter: true,
      fixedHeader: true
    },
    _react2.default.createElement(
      Header,
      null,
      _react2.default.createElement(
        Row,
        null,
        _react2.default.createElement(
          RowColumn,
          { sort: ['_id'] },
          'ID'
        ),
        _react2.default.createElement(
          RowColumn,
          { sort: ['name'], order: 'desc' },
          'Name'
        ),
        _react2.default.createElement(
          RowColumn,
          { sort: ['status'] },
          'Status'
        )
      )
    ),
    _react2.default.createElement(
      Body,
      null,
      _react2.default.createElement(
        Row,
        {
          value: { _id: 1, status: 'Employed', name: 'Samuel Roberts' },
          onRowClick: function onRowClick() {},
          onCellClick: function onCellClick() {},
          selected: true
        },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 1'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Samuel Roberts'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Employed'
        )
      ),
      _react2.default.createElement(
        Row,
        { value: { _id: 2, status: 'Employed', name: 'Steve Brown' } },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 2'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Steve Brown'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Employed'
        )
      ),
      _react2.default.createElement(
        Row,
        { value: { _id: 3, status: 'Employed', name: 'Stephanie Sanders' }, selected: true },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 3'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Stephanie Sanders'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Employed'
        )
      ),
      _react2.default.createElement(
        Row,
        { value: { _id: 4, status: 'Employed', name: 'Adam Moore' } },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 4'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Adam Moore'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Employed'
        )
      ),
      _react2.default.createElement(
        Row,
        { value: { _id: 5, status: 'Unemployed', name: 'Randal White' } },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 5'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Randal White'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Unemployed'
        )
      ),
      _react2.default.createElement(
        Row,
        { value: { _id: 6, status: 'Employed', name: 'Samuel Roberts' } },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 6'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Samuel Roberts'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Employed'
        )
      ),
      _react2.default.createElement(
        Row,
        { value: { _id: 7, status: 'Employed', name: 'Steve Brown' } },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 7'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Steve Brown'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Employed'
        )
      ),
      _react2.default.createElement(
        Row,
        { value: { _id: 8, status: 'Employed', name: 'Stephanie Sanders' } },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 8'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Stephanie Sanders'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Employed'
        )
      ),
      _react2.default.createElement(
        Row,
        { value: { _id: 9, status: 'Employed', name: 'Adam Moore' } },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 9'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Adam Moore'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Employed'
        )
      ),
      _react2.default.createElement(
        Row,
        { value: { _id: 10, status: 'Unemployed', name: 'Randal White' } },
        _react2.default.createElement(
          RowColumn,
          null,
          'ID 10'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Randal White'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'Unemployed'
        )
      )
    ),
    _react2.default.createElement(
      Footer,
      null,
      _react2.default.createElement(
        Row,
        null,
        _react2.default.createElement(
          RowColumn,
          null,
          'footer ID'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'footer Name'
        ),
        _react2.default.createElement(
          RowColumn,
          null,
          'footer Status'
        )
      )
    )
  )).toJSON();
  expect(tree).toMatchSnapshot();
});