import { mount } from 'enzyme';
import * as HIG from 'hig.web';
import React from 'react';

import GlobalNav from './GlobalNav';
import SideNav from './SideNav';
import Search from './Search'
import Section from './Section';
import SectionList from './SectionList';
import Group from './Group';
import Module from './Module';
import Submodule from './Submodule';

import SharedExamples from './SharedExamples';


const Context = props => {
  return (
    <GlobalNav>
      <SideNav>
        <Search placeholder={props.placeholder}/> 
        <SectionList>
          <Section>
            <Group>
              <Module tile={props.moduleTitle}>
                <Submodule title={props.submoduleTitle}/>
              </Module>  
            </Group>
          </Section>  
        </SectionList>
      </SideNav>  
    </GlobalNav>  
  )
}

function setUpSearch(){
  const defaults = {
      placeholder: 'Search for something',
      submoduleTitle: "Document New",
      moduleTitle: "Docoument Workflow"
  };

  const reactContainer = document.createElement('div');
  const wrapper = mount(<Context {... defaults} />, {attachTo: reactContainer} );
  return { wrapper, reactContainer };
}

describe('<Search>', () => {
  it('will is rendered as a child of Side Nav', () => {
    const { reactContainer } = setUpSearch();

    expect(reactContainer.firstChild.outerHTML).toMatchSnapshot();
  });
});

@@ -1,12 +1,575 @@
+/**%0ACopyright 2016 Autodesk,Inc.%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A    http://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A%0A*/%0A%0A
 import %7B mou

add copyright to search test