'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _reactTestRenderer2 = _interopRequireDefault(_reactTestRenderer);

var _SelectDisplayMode = require('./SelectDisplayMode.component');

var _SelectDisplayMode2 = _interopRequireDefault(_SelectDisplayMode);

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

jest.mock('react-dom');

var requiredProps = {
	onChange: jest.fn()
};

describe('SelectDisplayMode', function () {
	it('should render', function () {
		// when
		var wrapper = _reactTestRenderer2.default.create(_react2.default.createElement(_SelectDisplayMode2.default, requiredProps)).toJSON();

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

	it('should render with displayMode = table', function () {
		// when
		var wrapper = _reactTestRenderer2.default.create(_react2.default.createElement(_SelectDisplayMode2.default, _extends({ mode: 'table' }, requiredProps))).toJSON();

		// then
		expect(wrapper).toMatchSnapshot();
	});
	it('should render with displayMode = large', function () {
		// when
		var wrapper = _reactTestRenderer2.default.create(_react2.default.createElement(_SelectDisplayMode2.default, _extends({ mode: 'large' }, requiredProps))).toJSON();

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

	it('should render with displayMode = tile', function () {
		// when
		var wrapper = _reactTestRenderer2.default.create(_react2.default.createElement(_SelectDisplayMode2.default, _extends({ mode: 'tile' }, requiredProps))).toJSON();

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

	it('should render id if provided', function () {
		// when
		var wrapper = _reactTestRenderer2.default.create(_react2.default.createElement(_SelectDisplayMode2.default, _extends({ id: 'toolbar-display-mode' }, requiredProps))).toJSON();

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