import React from 'react';
import expect from 'expect';
import expectJSX from 'expect-jsx';
import { shallow } from 'enzyme';
import { createRenderer } from 'react-addons-test-utils';
import MDDropDownMenu from 'src/MDDropDownMenu';

expect.extend(expectJSX);

describe('MDDropDownMenu', () => {
  describe('with input', () => {
    let wrapper;
    const options = ['xixi', 'haha', 'hehe'];
    before(() => {
      wrapper = shallow(
        <MDDropDownMenu
          width={50}
          height={60}
          options={options}
          defaultOption={'xixi'}
          />
      );
    });

    it('size should be input', () => {
       expect(wrapper.props().style).toEqual({width: 50});
       expect(wrapper.childAt(0).props().style).toInclude({height: 60});
    });

    it('defaultOption should be same with input', () => {
      const defaultOption = wrapper.childAt(0).childAt(0).props().children;
      expect(defaultOption).toEqual('xixi');
    });

    it('defaultOption should be initally within options', () => {
      const defaultOption = wrapper.childAt(0).childAt(0).props().children
      expect(options).toInclude(defaultOption);
    });

    it('defaultOption should be then moved out of options', ()=> {
      const optionsList = wrapper
      .find('li')
      .children()
      .forEach(node => expect(options).toExclude(node.children))
    });

  });

  describe('with onSelect func', () => {
    let wrapper;
    before(() => {
      wrapper = shallow(
        <MDDropDownMenu
          options={['xixi', 'haha']}
          defaultOption={'xixi'}
          onSelect
          />
      );
    });

  });


});

@@ -101,16 +101,23 @@
  shallow
+, mount
  %7D from 
@@ -232,16 +232,40 @@
 wnMenu';
+%0Aimport $ from 'jquery';
 %0A%0Aexpect
@@ -1391,25 +1391,24 @@
 n))%0A    %7D);%0A
-%0A
   %7D);%0A%0A  des
@@ -1655,13 +1655,536 @@
 %0A  %7D);%0A%0A
+  describe('multiple menus', () =%3E %7B%0A    let wrapper;%0A    before(() =%3E %7B%0A      wrapper = mount(%0A        %3Cdiv%3E%0A          %3CMDDropDownMenu%0A            options=%7B%5B'xixi', 'haha'%5D%7D%0A            defaultOption=%7B'xixi'%7D%0A          /%3E%0A          %3CMDDropDownMenu%0A            options=%7B%5B'xixi', 'haha'%5D%7D%0A            defaultOption=%7B'xixi'%7D%0A          /%3E%0A        %3C/div%3E%0A      );%0A    %7D);%0A%0A    it('opening in one dropdownmenu should close others', () =%3E %7B%0A      // because the styles are ignored. Don't know how to write this test%0A    %7D);%0A  %7D)%0A
 %0A%7D);%0A

add test structure but don't know how to test