"use strict";

var _react = _interopRequireDefault(require("react"));

var _enzyme = require("enzyme");

var _index = require("../../styles/index.js");

var _index2 = require("../index.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
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.
*/
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 = (0, _enzyme.mount)(_react.default.createElement(_index2.HeaderNavigation, allProps, children));
    expect(wrapper).toMatchSnapshot('Component has correct render');
  });
  test('should replace overridden root', function () {
    var newRoot = (0, _index.styled)('div', {
      color: 'red'
    });
    newRoot.displayName = "newRoot";
    allProps.overrides = {
      Root: newRoot
    };
    wrapper = (0, _enzyme.mount)(_react.default.createElement(_index2.HeaderNavigation, allProps, children));
    var renderedRoot = wrapper.find(allProps.overrides.Root);
    expect(renderedRoot).toHaveLength(1);
  });
});