jest.unmock('../Header');

import React from 'react';
import TestUtils from 'react-addons-test-utils';
import { Header } from '../Header';

xdescribe('Header', () => {

    it('should have title', () => {
        const container = <Header name="test title" />;
        const DOM = TestUtils.renderIntoDocument(container);
        const title = TestUtils.findRenderedDOMComponentWithTag(
            DOM, 'h1');

        expect(title.textContent).toEqual('test title');
    });

    it('should have only one h1', () => {
        const container = <Header name="title" />;
        const DOM = TestUtils.renderIntoDocument(container);
        const title = TestUtils.scryRenderedDOMComponentsWithTag(
            DOM, 'h1');

        expect(title.length).toEqual(1);
    });
});

import React from "react";
import Header from "../Header";
import { shallow } from "enzyme";

describe('Header', () => {
    let wrapper;

    it('should have only title', () => {
        const props = {
            name: 'name'
        };
        wrapper = shallow(<Header {...props} />);
        expect(wrapper.find('.breadcrumbs__item').length).toEqual(1);
    });

    it('should have only header info', () => {
        const props = {
            headerInfo: <Header/>//TODO mockElement
        };
        wrapper = shallow(<Header {...props} />);
        expect(wrapper.find('.breadcrumbs__item').length).toEqual(1);
    });

    it('should have both name and header info', () => {
        const props = {
            name: 'name',
            headerInfo: <Header/>//TODO mockElement
        };
        console.log(wrapper.find('.breadcrumbs__item').length);
        wrapper = shallow(<Header {...props} />);
        expect(wrapper.find('.breadcrumbs__item').length).toEqual(2);
    });

});

Fix unit tests for Header component
Fix unit tests for Header component
