'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _enzyme = require('enzyme');

var _Row = require('./Row.component');

var _Row2 = _interopRequireDefault(_Row);

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

describe('RowRenderer', function () {
	it('should show a skeleton during the scroll', function () {
		var Row = new _Row2.default({
			selectionToggle: null
		});

		// when
		var wrapper = (0, _enzyme.shallow)(_react2.default.createElement(Row, {
			className: 'my-class-names',
			index: 1,
			key: 18,
			parent: {},
			style: { background: 'red' },
			isScrolling: true
		}));

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

	it('should show a RowSelectionRenderer if the row is selected', function () {
		// given
		var Row = new _Row2.default({
			selectionToggle: function selectionToggle() {},
			isSelected: function isSelected() {}
		});

		// when
		var wrapper = (0, _enzyme.shallow)(_react2.default.createElement(Row, {
			className: 'my-class-names',
			index: 1,
			key: 18,
			parent: {},
			style: { background: 'red' }
		}));

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

	it('should show a DefaultTableRowRenderer by default', function () {
		var Row = new _Row2.default({
			selectionToggle: null
		});

		// when
		var wrapper = (0, _enzyme.shallow)(_react2.default.createElement(Row, {
			className: 'my-class-names',
			index: 1,
			key: 18,
			parent: {},
			style: { background: 'red' }
		}));

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