import React from 'react';
import Adapter from 'enzyme-adapter-react-16';
import Enzyme, { shallow, mount } from 'enzyme';
import DropdownMenu from './DropdownMenu';
import Button from '../button';
import Menu, { MenuItem } from '../menu';
Enzyme.configure({
  adapter: new Adapter()
});
describe('<Menu />', function () {
  var mockCallback = jest.fn();
  var demo = /*#__PURE__*/React.createElement(DropdownMenu, {
    style: {
      width: '100px'
    },
    anchorEl: /*#__PURE__*/React.createElement(Button, null, "Dropdown"),
    defaultIsOpen: true
  }, /*#__PURE__*/React.createElement(Menu, {
    disableAutoIndent: true,
    onSelect: mockCallback
  }, /*#__PURE__*/React.createElement(MenuItem, {
    value: 1,
    key: "item1"
  }, "item1"), /*#__PURE__*/React.createElement(MenuItem, {
    value: 2,
    key: "item2"
  }, "item2"), /*#__PURE__*/React.createElement(MenuItem, {
    value: 3,
    key: "item3"
  }, "item3"), /*#__PURE__*/React.createElement(MenuItem, {
    value: 4,
    key: "item4"
  }, "item4"), /*#__PURE__*/React.createElement(MenuItem, {
    value: 5,
    key: "item5"
  }, "item5")));
  test('选择项目', function () {
    mount(demo);
    document.querySelector('.ne-menu-item').click(); // console.log(mockCallback.mock.calls[0]);

    expect(mockCallback.mock.calls[0][1]).toBe(1);
  });
});