'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _reactTestRenderer2 = _interopRequireDefault(_reactTestRenderer);

var _HeaderInput = require('./HeaderInput.component');

var _HeaderInput2 = _interopRequireDefault(_HeaderInput);

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

describe('Header', function () {
	it('should render filter header', function () {
		// given
		var props = {
			inputPlaceholder: 'Search',
			headerInput: [{
				label: 'Abort',
				icon: 'talend-cross',
				id: 'abort',
				onClick: jest.fn() // provided click callback
			}]
		};

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

		var rendererOptions = { createNodeMock: createNodeMock };

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

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