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 = React.createElement(DropdownMenu, {
    style: {
      width: '100px'
    },
    anchorEl: React.createElement(Button, null, "Dropdown"),
    defaultIsOpen: true
  }, React.createElement(Menu, {
    disableAutoIndent: true,
    onSelect: mockCallback
  }, React.createElement(MenuItem, {
    value: 1,
    key: "item1"
  }, "item1"), React.createElement(MenuItem, {
    value: 2,
    key: "item2"
  }, "item2"), React.createElement(MenuItem, {
    value: 3,
    key: "item3"
  }, "item3"), React.createElement(MenuItem, {
    value: 4,
    key: "item4"
  }, "item4"), 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);
  });
});