{"size": 1464, "ext": "js", "max_stars_repo_path": "src/shared/components/Header/Header.test.js", "max_stars_repo_name": "Mike1Q84/react-ssr-simple", "max_stars_repo_stars_event_min_datetime": "2017-09-11T02:37:42.000Z", "max_stars_repo_stars_event_max_datetime": "2017-09-11T02:37:42.000Z", "max_issues_repo_path": "src/shared/components/Header/Header.test.js", "max_issues_repo_name": "Mike1Q84/react-ssr-simple", "max_issues_repo_issues_event_min_datetime": "2017-09-11T02:38:33.000Z", "max_issues_repo_issues_event_max_datetime": "2017-09-11T13:29:38.000Z", "max_forks_repo_path": "src/shared/components/Header/Header.test.js", "max_forks_repo_name": "Mike1Q84/react-ssr-simple", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 27.6226415094, "max_line_length": 82, "alphanum_fraction": 0.5601092896}
import React from 'react';
import { expect } from 'chai';
import { shallow, configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });

import Header from './Header';
import t from './_lang.json';

describe('Header', () => {
  const props = {
    'lang': { id: 'en-AU', name: 'English(AU)' },
    'languages': [
      { id: 'en-AU', name: 'English(AU)' },
      { id: 'zh-CN', name: '中文（简体）' }
    ]
  };

  let wrapper;

  beforeEach(() => {
    wrapper = shallow(<Header {...props}/>);
  });

  it("should be rendered", () => {
    expect(wrapper.find('.header')).to.have.length(1);
  });
  it("should display title", () => {
    expect(wrapper.find('.header__title').text()).to.equal(t[props.lang.id].name);
  });
  it("should display language", () => {
    expect(wrapper.find('.header__lang')).to.have.length(1);
  });

  describe('Navbar', () => {
    it("should be rendered", () => {
      expect(wrapper.find('.navbar')).to.have.length(1);
    });

    describe('NavBtn', () => {
      it("should display dropdown button", () => {
        expect(wrapper.find('.navbtn')).to.have.length(1);
        expect(wrapper.find('.navbtn__line1')).to.have.length(1);
        expect(wrapper.find('.navbtn__line2')).to.have.length(1);
        expect(wrapper.find('.navbtn__line3')).to.have.length(1);
      });
      // it('should toggle navbtn style after clicked', () => {
      //
      // });
    });
  });
});
