'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _reactTestRenderer2 = _interopRequireDefault(_reactTestRenderer);

var _HeaderSelected = require('./HeaderSelected.component');

var _HeaderSelected2 = _interopRequireDefault(_HeaderSelected);

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

describe('Header', function () {
	it('should render header with trash icon in case of multiple selection', function () {
		// given
		var props = {
			headerSelected: [{
				disabled: false,
				label: 'Validate',
				icon: 'talend-check',
				id: 'validate',
				onClick: jest.fn() // provided click callback
			}],
			nbItemsSelected: 2
		};

		function createNodeMock(element) {
			if (element.type === 'input') {
				return {};
			}
			return null;
		}
		var rendererOptions = { createNodeMock: createNodeMock };

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

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