'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _reactTestRenderer2 = _interopRequireDefault(_reactTestRenderer);

var _Content = require('./Content.component');

var _Content2 = _interopRequireDefault(_Content);

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

jest.mock('react-dom');

var columns = [{ key: 'icon', label: '', type: 'icon' }, { key: 'name', label: 'Name', type: 'title' }, { key: 'author', label: 'Author' }, { key: 'created', label: 'Created' }, { key: 'modified', label: 'Modified' }];
var items = [{
	id: 1,
	name: 'Hello world',
	created: '2016-09-22',
	modified: '2016-09-22',
	author: 'Jean-Pierre DUPONT',
	icon: 'fa fa-file-excel-o',
	className: 'item-0-class'
}, {
	id: 2,
	name: 'Foo',
	created: '2016-09-22',
	modified: '2016-09-22',
	author: 'Jean-Pierre DUPONT',
	icon: 'fa fa-file-pdf-o',
	className: 'item-1-class'
}, {
	id: 2,
	name: 'Bar',
	created: '2016-09-22',
	modified: '2016-09-22',
	author: 'Jean-Pierre DUPONT'
}];

describe('Content', function () {
	it('should render', function () {
		// given
		var props = {
			items: items,
			columns: columns
		};

		// when
		var wrapper = _reactTestRenderer2.default.create(_react2.default.createElement(_Content2.default, props)).toJSON();

		// then
		expect(wrapper).toMatchSnapshot();
	});

	it('should render with id if provided', function () {
		// given
		var props = {
			id: 'list-items',
			items: items,
			columns: columns
		};

		// when
		var wrapper = _reactTestRenderer2.default.create(_react2.default.createElement(_Content2.default, props)).toJSON();

		// then
		expect(wrapper).toMatchSnapshot();
	});

	it('should render with display mode if provided', function () {
		// given
		var props = {
			displayMode: 'tile',
			items: items,
			columns: columns
		};

		// when
		var wrapper = _reactTestRenderer2.default.create(_react2.default.createElement(_Content2.default, props)).toJSON();

		// then
		expect(wrapper).toMatchSnapshot();
	});
});