'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);

var _Title = require('../Title');

var _Title2 = _interopRequireDefault(_Title);

var _Article = require('../Article');

var _Article2 = _interopRequireDefault(_Article);

var _Icon = require('../Icon');

var _Icon2 = _interopRequireDefault(_Icon);

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

// eslint-disable-line import/no-extraneous-dependencies

test('Cropper renders correctly', function () {
  var items = [{ id: 'sigfox', name: 'Sigfox', description: 'Aliquam vestibulum a nisl sit amet imperdiet.' }, { id: 'study', name: 'Qualification', description: 'Aenean at neque dolor. Aliquam id ipsum quis quam.' }, { id: 'start', name: 'Prototyping', description: 'Cras sodales vel mi vitae semper. Curabitur dictum.' }, { id: 'development', name: 'Development', description: 'Sed at pretium ante, vel dignissim nibh..' }, { id: 'certification', name: 'Certification', description: 'Nam ullamcorper pharetra quam fringilla efficitur.' }, { id: 'industrialization', name: 'Industrialization', description: 'Maecenas pulvinar imperdiet tincidunt.' }, { id: 'user', name: 'My user', description: 'Vestibulum commodo orci mauris, non tempor leo consequat ac.' }, { id: 'device', name: 'My device', description: 'Sed sit amet libero in justo viverra auctor eget sit amet odio.' }, { id: 'briefcase', name: 'My project', description: 'Duis consequat libero sit amet massa mattis feugiat.' }, { id: 'company', name: 'My company', description: 'Donec eleifend justo augue. Vivamus magna neque, ullamcorper.' }, { id: 'wrench', name: 'My admin', description: 'Duis accumsan sagittis rhoncus. Integer condimentum.' }];

  var tree = _reactTestRenderer2.default.create(_react2.default.createElement(
    _index2.default,
    {
      items: items,
      itemRender: function itemRender(_ref) {
        var id = _ref.id;
        return _react2.default.createElement(_Icon2.default, {
          name: id,
          variant: 'circle',
          size: 'md',
          backgroundColor: 'x-light-grey',
          borderColor: 'light-grey',
          color: 'dark-grey'
        });
      },
      selectedId: 'study',
      columns: '5',
      collapse: false,
      scrollJump: true
    },
    function (_ref2) {
      var name = _ref2.name,
          description = _ref2.description;
      return _react2.default.createElement(
        'div',
        null,
        _react2.default.createElement(
          _Title2.default,
          { level: 4, withoutMargeTop: true },
          name
        ),
        _react2.default.createElement(
          _Article2.default,
          null,
          description
        )
      );
    }
  )).toJSON();
  expect(tree).toMatchSnapshot();
});