'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _enzyme = require('enzyme');

var _CellActions = require('./CellActions.component');

var _CellActions2 = _interopRequireDefault(_CellActions);

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

var actions = [{
	id: 'action-1',
	label: 'Simple action',
	icon: 'talend-pencil',
	onClick: jest.fn()
}, {
	id: 'action-2',
	displayMode: 'dropdown',
	label: 'Dropdown action',
	icon: 'talend-file-o',
	items: [{
		label: 'Document 1',
		onClick: jest.fn()
	}, {
		label: 'Document 2',
		onClick: jest.fn()
	}]
}, {
	id: 'action-3',
	displayMode: 'splitDropdown',
	label: 'Split dropdown action',
	onClick: jest.fn(),
	items: [{
		label: 'File 1',
		onClick: jest.fn()
	}, {
		label: 'File 2',
		onClick: jest.fn()
	}]
}];

describe('CellActions', function () {
	it('should render actions', function () {
		// when
		var wrapper = (0, _enzyme.shallow)(_react2.default.createElement(_CellActions2.default, { cellData: actions }));

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