'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _reactTestRenderer2 = _interopRequireDefault(_reactTestRenderer);

var _Items = require('./Items.component');

var _Items2 = _interopRequireDefault(_Items);

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

jest.mock('../../../node_modules/react-virtualized/dist/commonjs/AutoSizer/AutoSizer', function () {
	return function (props) {
		return _react2.default.createElement(
			'div',
			{ id: 'autoSizer' },
			props.children({ height: 30, width: 30 })
		);
	};
} // eslint-disable-line react/prop-types
);

describe('Items', function () {
	it('should display a checked item between the two others', function () {
		// given
		var props = {
			items: Array(3).fill('').map(function (item, index) {
				return {
					label: 'Lorem ipsum dolor sit amet ' + index
				};
			}),
			getItemHeight: function getItemHeight() {
				return 42;
			}
		};

		props.items[1].checked = true;

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

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