import React from 'react';
import Adapter from 'enzyme-adapter-react-16';
import Enzyme, { shallow, mount } from 'enzyme';
import Tabs from './index';
Enzyme.configure({
  adapter: new Adapter()
});
describe('<Tabs />', function () {
  var demo = React.createElement(Tabs, {
    defaultValue: 1
  }, React.createElement(Tabs.Tab, {
    key: "1"
  }, "tab1"), React.createElement(Tabs.Tab, {
    key: "2"
  }, "tab2"));
  test('正确渲染', function () {
    var wrapper = shallow(demo);
    expect(wrapper).toMatchSnapshot();
  });
  test('选择项目', function () {
    var wrapper = mount(demo);
    expect(wrapper.find('.ne-tab-selected').text()).toBe('tab2');
    wrapper.find('Tab').first().simulate('click');
    expect(wrapper.find('.ne-tab-selected').text()).toBe('tab1');
  });
});