/*
Copyright (c) 2018 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import { mount } from 'enzyme';
import { styled } from '../../styles/index.js';
import { HeaderNavigation } from '../index.js';
describe('Stateless header navigation', function () {
  var wrapper, children;
  var allProps = {};
  beforeEach(function () {
    children = 'Some tag';
  });
  afterEach(function () {
    jest.restoreAllMocks();
    wrapper && wrapper.unmount();
  });
  test('should render component', function () {
    wrapper = mount(React.createElement(HeaderNavigation, allProps, children));
    expect(wrapper).toMatchSnapshot('Component has correct render');
  });
  test('should replace overridden root', function () {
    var newRoot = styled('div', {
      color: 'red'
    });
    newRoot.displayName = "newRoot";
    allProps.overrides = {
      Root: newRoot
    };
    wrapper = mount(React.createElement(HeaderNavigation, allProps, children));
    var renderedRoot = wrapper.find(allProps.overrides.Root);
    expect(renderedRoot).toHaveLength(1);
  });
});